Workbackup

This commit is contained in:
Michael Rest
2018-02-16 11:52:56 +01:00
parent 52cc47766a
commit 5270c6709d
1321 changed files with 150878 additions and 0 deletions

14
BC_Grinder.apj Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.3.4.121 SP"?>
<Project Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<Communication />
<ANSIC DefaultIncludes="true" />
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
<Project StoreRuntimeInProject="true" />
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
<TechnologyPackages>
<Acp10Arnc0 Version="3.18.2" />
<mapp Version="1.62.1" />
</TechnologyPackages>
</Project>

7
LastUser.set Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.3.4.121 SP"?>
<ProjectSettings xmlns="http://br-automation.co.at/AS/ProjectSettings">
<ConfigurationManager ActiveConfigurationName="Config1" />
<Deployment Value="ActiveCpu" />
<Print Footer="%cPage: %p" Header="%lProject: %n%c%x" />
</ProjectSettings>

View File

@@ -0,0 +1,8 @@
TYPE
typAlarm : STRUCT (*Alarm Datenstruktur*)
Alarm : ARRAY[0..127]OF BOOL;
Ack : ARRAY[0..127]OF BOOL;
Bypass : ARRAY[0..127]OF BOOL;
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,24 @@
VAR
bBlink0_1 : BOOL;
bBlink0_5 : BOOL;
bBlink1_0 : BOOL;
bBlink2_0 : BOOL;
bBlink5_0 : BOOL;
gdtCurrentTime : DATE_AND_TIME; (*Current Date and Time*)
gDTstrucCurrentTime : DTStructure := (0); (*Current Date and Time as DTStructure*)
gsCurrentTime : STRING[25] := ''; (*Current Date and Time as String*)
gTCurrentTime : TIME := T#0ms; (*Current Time*)
END_VAR
VAR CONSTANT
gAInNull : INT := 0; (*O FOR Analog Input*)
gTrue : BOOL := TRUE; (*Konstant TRUE*)
gFalse : BOOL := FALSE; (*Konstant False*)
gInNull : BOOL := FALSE; (*FALSE FOR Input *)
END_VAR
VAR
gOuNull : BOOL; (*DUMMY for Output*)
END_VAR
VAR CONSTANT
iAIVoltageOverflow : INT := 16#7FFF; (* Analog Input Voltage Mode,Overflow *)
iAIVoltageUnderflow : INT := -32767; (* Analog Input Voltage Underflow *)
END_VAR

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="File">GlobalCommon.typ</Object>
<Object Type="File">GlobalComon.var</Object>
<Object Type="Program" Language="IEC" Description="Current Date_And_Time / DT Struct">get_dt</Object>
<Object Type="Program" Language="IEC" Description="Blinker 0,1 -0,5s (f. 100ms Task) !!!">blinker</Object>
</Objects>
</Package>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File Description="Local variables" Private="true">blinker.var</File>
<File Description="Initialization code">blinkerInit.ab</File>
<File Description="Cyclic code">blinkerCyclic.ab</File>
</Files>
</Program>

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- kA
********************************************************************
* Program: blinker
* File: blinker.var
* Author: michi
* Created: November 23, 2009
********************************************************************
* Local variables of program blinker
********************************************************************)
VAR
iCount : USINT;
END_VAR

View File

@@ -0,0 +1,30 @@
(********************************************************************
* COPYRIGHT -- kA
********************************************************************
* Program: blinker
* File: blinkerCyclic.ab
* Author: michi
* Created: November 23, 2009
********************************************************************
* Implementation of program blinker
********************************************************************)
PROGRAM _CYCLIC
(* cyclic program *)
;Has to be taskclass 100ms
bBlink0_1 = not bBlink0_1
inc (iCount)
if ((iCount mod 5) = 0) then
bBlink0_5 = not bBlink0_5
endif
if ((iCount mod 10) = 0) then
bBlink1_0 = not bBlink1_0
endif
if ((iCount mod 20) = 0) then
bBlink2_0 = not bBlink2_0
endif
if ((iCount mod 50) = 0) then
bBlink5_0 = not bBlink5_0
iCount = 0
endif
END_PROGRAM

View File

@@ -0,0 +1,16 @@
(********************************************************************
* COPYRIGHT -- kA
********************************************************************
* Program: blinker
* File: blinkerInit.ab
* Author: michi
* Created: November 23, 2009
********************************************************************
* Implementation of program blinker
********************************************************************)
PROGRAM _INIT
iCount = 0
END_PROGRAM

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File>get_dtCyclic.ab</File>
<File Private="true">get_dt.var</File>
<File>get_dtInit.ab</File>
</Files>
</Program>

View File

@@ -0,0 +1,6 @@
VAR
sTemp : STRING[10] := '';
lDTStructureGetTime : DTStructureGetTime := (0);
lDTGetTime : DTGetTime := (0);
lTimeStructure : TIMEStructure := (0);
END_VAR

View File

@@ -0,0 +1,57 @@
PROGRAM _CYCLIC
(* cyclic program *)
lDTGetTime.enable = true
lDTGetTime FUB DTGetTime()
gdtCurrentTime = lDTGetTime.DT1
lDTStructureGetTime.enable = true
lDTStructureGetTime FUB DTStructureGetTime ()
lDTStructureGetTime.pDTStructure = adr (gDTstrucCurrentTime)
ascDTStructure (ADR (gDTstrucCurrentTime), ADR (gsCurrentTime), 25)
brsstrcpy (ADR (gsCurrentTime), "")
brsitoa (gDTstrucCurrentTime.year, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
IF (gDTstrucCurrentTime.month < 10) THEN
brsstrcat (ADR (gsCurrentTime), "0")
ENDIF
brsitoa (gDTstrucCurrentTime.month, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
IF (gDTstrucCurrentTime.day < 10) THEN
brsstrcat (ADR (gsCurrentTime), "0")
ENDIF
brsitoa (gDTstrucCurrentTime.day, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), "_")
IF (gDTstrucCurrentTime.hour < 10) THEN
brsstrcat (ADR (gsCurrentTime), "0")
ENDIF
brsitoa (gDTstrucCurrentTime.hour, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), "-")
IF (gDTstrucCurrentTime.minute < 10) THEN
brsstrcat (ADR (gsCurrentTime), "0")
ENDIF
brsitoa (gDTstrucCurrentTime.minute, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), "-")
IF (gDTstrucCurrentTime.second < 10) THEN
brsstrcat (ADR (gsCurrentTime), "0")
ENDIF
brsitoa (gDTstrucCurrentTime.second, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), "_")
brsitoa (gDTstrucCurrentTime.millisec, ADR (sTemp))
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
lTimeStructure.day = gDTstrucCurrentTime.day
lTimeStructure.hour = gDTstrucCurrentTime.hour
lTimeStructure.minute = gDTstrucCurrentTime.minute
lTimeStructure.second = gDTstrucCurrentTime.second
lTimeStructure.millisec = gDTstrucCurrentTime.millisec
lTimeStructure.microsec = gDTstrucCurrentTime.microsec
gTCurrentTime = TIMEStructure_TO_TIME (adr (lTimeStructure))
END_PROGRAM

View File

@@ -0,0 +1,4 @@
PROGRAM _INIT
(* init program *)
END_PROGRAM

4
Logical/Global.var Normal file
View File

@@ -0,0 +1,4 @@
VAR
gAxis1 : ACP10AXIS_typ;
gAxis2 : ACP10AXIS_typ;
END_VAR

View File

@@ -0,0 +1,97 @@
TYPE
ACPinverter_typ : STRUCT (*Acopos Inverter*)
bModuleOK : BOOL;
In : ACPinverterIn_typ;
Out : ACPinverterOut_typ;
END_STRUCT;
ACPinverterIn_typ : STRUCT (*Acopos Inverter Inputs*)
bStat00_ReadytoSwitchOn : BOOL;
bStat01_SwitchedOnReady : BOOL;
bstat02_Enabled : BOOL;
bStat03_FaultDetecton : BOOL;
bStat04_VoltageDisabled : BOOL;
bStat05_QuickstopINV : BOOL;
bStat06_SwitchedOnDisabled : BOOL;
bStat07_Alarm : BOOL;
bStat09_ReferenceViaNetwork : BOOL;
bStat10_TargetReferenceReached : BOOL;
bStat11_InternalLimitActive : BOOL;
bStat14_StopViaKey : BOOL;
bStat15_RotationDirection : BOOL;
bExtStat00_EEPROM_NonVolatile : BOOL;
bExtStat01_ParameterConsCheck : BOOL;
bExtStat02_DriveInFault : BOOL;
bExtStat04_SpeedModeActive : BOOL;
bExtStat05_DCInjection : BOOL;
bExtStat06_TransientState : BOOL;
bExtStat07_ThermalTreshold : BOOL;
bExtStat08_Overbraking : BOOL;
bExtStat09_Accelerating : BOOL;
bExtStat10_Decellerating : BOOL;
bExtStat11_I_Limited : BOOL;
bExtStat12_FastStopping : BOOL;
bExtStat13_ExtControlled0 : BOOL;
bExtStat14_ExtCondrolled1 : BOOL;
bExtStat15_OperationDir : BOOL;
iRFRD_Velocity : INT;
iOTR_Torque : INT;
uiLCR_Current : UINT;
uiTHD_ThermalStateDrive : UINT;
uiTHR_ThermalStatMotor : UINT;
bInputLI1 : BOOL;
bInputLI2 : BOOL;
bInputLI3 : BOOL;
bInputLI4 : BOOL;
bRelay2State : BOOL;
uiErrorCode : UINT;
iLastFault : INT;
END_STRUCT;
ACPinverterOut_typ : STRUCT (*Acopos Inverter Outputs*)
bCmd00_SwitchOn : BOOL;
bCmd01_DisableVoltage : BOOL;
bCmd02_QuickStop : BOOL;
bCmd03_EnableOperation : BOOL;
bCmd07_ResetFault : BOOL;
bCmd11_Direction : BOOL;
bCmd12_StopCommand : BOOL;
bCmd13 : BOOL;
bCmd14 : BOOL;
bCmd15 : BOOL;
bCmi00_FactorySettings : BOOL;
bCmi01_SaveToEEPROM : BOOL;
bCmi03_ExternalFault : BOOL;
bCmi04_RampSwitching : BOOL;
bCmi09_FrequencyReference : BOOL;
bCmi13_LockOnStandstill : BOOL;
bCmi15_CheckParameterConsitency : BOOL;
iLFR_Setpointspeed : INT;
bOR_Relay2 : BOOL;
END_STRUCT;
gtyp_PushButton : STRUCT (*Leuchtringtaster*)
bInKeyStatus : BOOL; (*Taster - Status*)
bOuGreen : BOOL; (*Leuchtring Gr<47>n*)
bOuYellow : BOOL; (*Leuchtring Gelb*)
bOuRed : BOOL; (*Leuchtring Rot*)
bOuWhite : BOOL; (*Leuchtring Wei<65>*)
bOuBlue : BOOL; (*Leuchtring Blau (Optional)*)
END_STRUCT;
gtyp_PowerSupply : STRUCT (*80PS Stromversorgung*)
In : gtyp_PowerSupplyInuts;
Out : gtyp_PowerSupplyOutputs;
END_STRUCT;
gtyp_PowerSupplyInuts : STRUCT (*80PS Stromversorgung*)
bIurrentLimitActive : BOOL; (*Strombegrenzung 01 aktiv*)
siVoltage : SINT; (*Ausgangsspannung 01 [V]*)
iCurrent : INT; (*Ausgangsstrom [0.1 A]*)
bErrorOutput : BOOL; (*Ausgang abgeschaltet*)
bErrorPhaseDetection : BOOL; (*Phasenausfall*)
bErrorOvertemperature : BOOL; (*<2A>bertemperatur*)
bErrorOverload : BOOL; (*<2A>berlast*)
bErrorOverVoltage : BOOL; (*<2A>berstrom*)
bError24VDC : BOOL; (*Fehler 24 Ausgang*)
END_STRUCT;
gtyp_PowerSupplyOutputs : STRUCT (*80PS Stromversorgung*)
bClearError : BOOL; (*St<53>rung quittieren*)
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,71 @@
(*================================================================================================================*)
(*CPU (PWLnk Node 240)*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gudSerialNrCPU : UDINT; (*Seriennummer*)
giTemperatureCPU : INT; (*CPU Temperatur*)
giTemperatureENV : INT; (*Umgebungstemperatur*)
gdiSystemTime : DINT;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF6.ST1 - SLX410*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST1ModuleOk : BOOL;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*Signals to Safe PLC*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbSPLCResetEStop : BOOL;
gbSPLCMachineOn : BOOL;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*Signals from Safe PLC*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbSPLCInEstopOk : BOOL; (*Safety PLC E-Stop ist Ok*)
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*I/O from SLX*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbSInEStop1Ok : BOOL; (*Sicherer Eingang 01/02 Equivalent - Nothalt*)
gbSInDoorsOk : BOOL; (*Sicherer Eingang 03/05 Equivalent - Schutzt<7A>r*)
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF6.ST2 - SO2110*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST2ModuleOk : BOOL;
gbSOuEnable5T1 : BOOL; (*Sicherer Ausgang 01 - Freigabe Umrichter 5T1*)
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF6.ST3 - 15K4 - DO9322 ( Ausg<73>nge Allgemein)*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST3ModuleOk : BOOL;
gbOuAcpInput1 : BOOL;
gbOuAcpEnable : BOOL;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF6.ST4 - 15K5 - DI9371 (Eing<6E>nge Allgemein)*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST4ModuleOk : BOOL;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF6.ST5 - BT9400 ( Bustransmitter P2)*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST5ModuleOk : BOOL;
END_VAR
(*----------------------------------------------------------------------------------------------------------------*)
(*IF1.ST6 - 4XP0043*)
(*----------------------------------------------------------------------------------------------------------------*)
VAR
gbIF6ST6ModuleOk : BOOL;
gPB1 : gtyp_PushButton; (*Leuchtringtaster 1*)
gPB2 : gtyp_PushButton; (*Leuchtringtaster 2*)
gPB3 : gtyp_PushButton; (*Leuchtringtaster 3*)
END_VAR

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="File">Global.typ</Object>
<Object Type="File" Description="Global variables / IOs">Global.var</Object>
</Objects>
</Package>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Version="3.18.2" Description="PLCopen Motion Control function blocks" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>acp10_mc.fun</File>
<File>acp10_mc.typ</File>
<File>acp10_mc.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="Sys_lib" FromVersion="0.00.0" />
<Dependency ObjectName="Brsystem" FromVersion="0.00.0" />
<Dependency ObjectName="Acp10man" FromVersion="3.18.2" ToVersion="3.18.2" />
</Dependencies>
</Library>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,278 @@
VAR CONSTANT
mc5TH_ORDER_POLYNOMIAL : UINT := 4; (*motion rule*)
mcABOVE_WINDOW : USINT := 40; (*trigger event mode*)
mcABS : USINT := 1; (*encoder type*)
mcABSOLUTE : USINT := 0; (*start mode*)
mcABSOLUTE_NO_RESET : USINT := 2; (*definition for the shift input of MC_BR_Offset and MC_BR_Phasing*)
mcACKNOWLEDGE_ALL : UINT := 2; (*acknowledge all error records immediately*)
mcACT_CFG : UINT := 1;
mcACTUAL_POSITION : UINT := 1; (*position source for MPDC*)
mcACTUAL_VELOCITY : INT := 10; (*PLCopen motion parameter*)
mcADD_DATE_TIME : UINT := 1; (*additional data object type*)
mcALL_AXES : UDINT := 16#FFFFFFFF;
mcALL_EVENTS : USINT := 255; (*event index*)
mcALL_PARAMS : USINT := 0; (*parameter index*)
mcALL_STATES : USINT := 255; (*state index*)
mcAUT_POS_TOLERANCE : INT := 1009; (*PLCopen motion parameter*)
mcAUTOMAT_POS : USINT := 100; (*additional movement direction*)
mcAVERAGE : UINT := 2;
mcAVERAGE_WEIGHTED : UINT := 4;
mcAXIS_ERROR : USINT := 0;
mcAXIS_FACTOR : INT := 1007; (*PLCopen motion parameter*)
mcAXIS_FACTOR_MAPPING : INT := 1019; (*PLCopen motion parameter*)
mcAXIS_NETWORK_CYCLE_TIME: INT := 1018; (*PLCopen motion parameter*)
mcAXIS_PERIOD : INT := 1008; (*PLCopen motion parameter*)
mcAXIS_PERIOD_MAPPING : INT := 1020; (*PLCopen motion parameter*)
mcAXIS_WARNING : USINT := 1;
mcBASIS_PARAMETERS : REAL := 2.0; (*Option for DefaultMoveParameter*)
mcBELOW_WINDOW : USINT := 50; (*trigger event mode*)
mcBESTFIT_5TH_ORDER : UINT := 1024; (*interpolation rule*)
mcBESTFIT_6TH_ORDER : UINT := 1280; (*interpolation rule*)
mcBLANK : UINT := 0;
mcBRAKE_CONTROL_INIT : USINT := 8; (*brake command*)
mcBRAKE_TEST_INIT : USINT := 2; (*brake command*)
mcBRAKE_TEST_START : USINT := 4; (*brake command*)
mcCALCULATION : UINT := 11; (*setup mode*)
mcCATCH_UP : USINT := 4; (*synchronization mode*)
mcCHECK : UINT := 1; (*mode for automat compensation check*)
mcCHECK_HOMING_OFF : USINT := 1; (*disable homing check*)
mcCLOSE : USINT := 0;
mcCMD_ERROR : UINT := 1; (*error command*)
mcCMD_ERROR_COAST_TO_STANDSTILL : UINT := 5; (*error command*)
mcCMD_ERROR_INDUCTION_HALT : UINT := 6; (*error command*)
mcCMD_ERROR_STOP : UINT := 2; (*error command*)
mcCMD_ERROR_STOP_CTRL_OFF : UINT := 3; (*error command*)
mcCMD_ERROR_V_STOP_CTRL_OFF : UINT := 4; (*error command*)
mcCMD_WARNING : UINT := 0; (*error command *)
mcCOMMANDED_POSITION : INT := 1; (*PLCopen motion parameter*)
mcCOMMANDED_VELOCITY : INT := 11; (*PLCopen motion parameter*)
mcCONTINUE_CONTROLLER_OFF : UINT := 128; (* continue if controller is off *)
mcCORRECT_CURRENT_CYCLE : UINT := 32768; (*additive StartMode for MC_BR_CrossCutterControl*)
mcCUBIC_SPLINE : UINT := 256; (*interpolation rule*)
mcCURRENT_DIR : USINT := 2; (*movement direction*)
mcCYCLIC : UINT := 2; (*event move mode*)
mcCYCLIC_ALL_EVENTS : UINT := 3; (*event move mode*)
mcDATOBJ : UINT := 0; (*data object type*)
mcDEFAULT_MOVE_PARAMETERS : INT := 1012; (*PLCopen motion parameter*)
mcDIRECT : USINT := 7; (*start mode*)
mcDIR_DEPENDENT : UINT := 1; (*mode for MPDC*)
mcDIR_DEPENDENT_BACKLASH : UINT := 2; (*mode for MPDC*)
mcDIR_DEPENDENT_SET_POSITION : UINT := 5; (*mode for MPDC*)
mcDIR_INDEPENDENT : UINT := 3; (*mode for MPDC*)
mcDIR_INDEPENDENT_SPEED : UINT := 4; (*mode for MPDC*)
mcDISTANCE_BASED : UINT := 0; (*basis for cam movement (e.g. for MC_BR_CamTransition)*)
mcDITHER : USINT := 32; (*setup mode*)
mcEDGE_SENSITIVE : USINT := 4; (*additional mode for trigger event*)
mcENABLE : UINT := 2;
mcENABLE_LIMIT_NEG : INT := 5; (*PLCopen motion parameter*)
mcENABLE_LIMIT_POS : INT := 4; (*PLCopen motion parameter*)
mcENABLE_POS_LAG_MONITORING : INT := 6; (*PLCopen motion parameter*)
mcENCODER : USINT := 0; (*setup mode*)
mcENCODER_POSITION : UINT := 2; (*position source for MPDC*)
mcEQUAL : UINT := 2;
mcEVERY_RECORD : UINT := 1; (*mode for MC_BR_CyclicRead*)
mcEXCEED_PERIOD : USINT := 8; (*movement direction*)
mcFB_ERROR : USINT := 2;
mcFB_INPUTS : REAL := 255.0; (*option for DefaultMoveParameters*)
mcFF : USINT := 32; (*setup, torque mode*)
mcFF_NEG_MOVE : UINT := 34; (*setup mode*)
mcFF_POS_MOVE : UINT := 33; (*setup mode*)
mcFILE : UINT := 1; (*data object type*)
mcFILE_BIN : UINT := 0; (*binary format*)
mcFILE_CSV : UINT := 1; (*CSV format*)
mcFILE_TXT : UINT := 2; (*text format*)
mcFIRST_RM : UINT := 0;
mcFIRST_TRIGGER : UINT := 2;
mcFLUX : USINT := 1; (*setup mode*)
mcGE : UINT := 6;
mcGET_BRAKE_STATUS : USINT := 16; (*brake command*)
mcGREATER : UINT := 4;
mcHARMONIC_COMBINATION : UINT := 8; (*motion rule*)
mcHOLDOFF_DISTANCE : UINT := 16384;
mcHOME_ABS_SWITCH : USINT := 2; (*homing mode*)
mcHOME_ABSOLUTE : USINT := 4; (*homing mode*)
mcHOME_ABSOLUTE_CORR : USINT := 6; (*homing mode*)
mcHOME_AXIS_REF : USINT := 12; (*homing mode *)
mcHOME_BLOCK_DS : USINT := 14; (*homing mode *)
mcHOME_BLOCK_TORQUE : USINT := 13; (*homing mode *)
mcHOME_DCM : USINT := 9; (*homing mode*)
mcHOME_DCM_CORR : USINT := 10; (*homing mode*)
mcHOME_DEFAULT : USINT := 0; (*homing mode*)
mcHOME_DIRECT : USINT := 1; (*homing mode*)
mcHOME_LIMIT_SWITCH : USINT := 3; (*homing mode*)
mcHOME_REF_PULSE : USINT := 5; (*homing mode*)
mcHOME_RESTORE_POS : USINT := 11; (*homing mode*)
mcHOME_SET_PHASE : USINT := 7; (*homing mode*)
mcHOME_SWITCH_GATE : USINT := 8; (*homing mode*)
mcHORIZONTAL : USINT := 0; (*setup option for controller setup*)
mcIDENTIFICATION : UINT := 10; (*setup mode *)
mcIMMEDIATE : UINT := 0; (*mode for MC_BR_RegMarkCalc001, StartMode for MC_BR_CrossCutterControl, *)
mcIN_WINDOW : USINT := 20; (*trigger event mode*)
mcINC : USINT := 2; (*encoder type*)
mcINC_ABS : USINT := 4; (*encoder type*)
mcINC_REF : USINT := 3; (*encoder type*)
mcINCLINED_SINE_CURVE : UINT := 5; (*motion rule*)
mcINTERVAL_EVENT : UINT := 16;
mcINVERSE : USINT := 255; (*encoder count direction*)
mcIPL_LINEAR : USINT := 1; (*interpolation mode*)
mcIPL_OFF : USINT := 0; (*interpolation mode*)
mcIPL_QUADRATIC : USINT := 2; (*interpolation mode*)
mcIPL_QUADRATIC_NO_OVERSHOOT : USINT := 4; (*interpolation mode*)
mcISQ_F1_NOTCH : UINT := 128; (*setup mode*)
mcISQ_F2_NOTCH : UINT := 256; (*setup mode*)
mcISQ_F3_NOTCH : UINT := 512; (*setup mode*)
mcISQ_RIPPLE : UINT := 20; (*setup mode*)
mcLAST_POINT : UINT := 0; (*motion rule*)
mcLEAD_IN : UINT := 2;
mcLEAD_OUT : UINT := 4;
mcLENGTH_ONLY : UINT := 32;
mcLIMIT : USINT := 40; (*torque mode*)
mcLIMIT_PARAMETERS : REAL := 1.0; (*option for DefaultMoveParameters*)
mcLINEAR_CAM : USINT := 253; (*predefined 1:1 cam profile for MC_BR_CamDwell*)
mcLINEAR_CAM_NON_PERIODIC : USINT := 254; (*for predifined 1:1 cam profile*)
mcLINEAR_CAM_PERIODIC : USINT := 255; (*for predefined 1:1 cam profile*)
mcLOAD : UINT := 276; (*trace command*)
mcMANUAL_SEARCH : UINT := 64;
mcMASTER_DISTANCE_BASED : UINT := 3; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
mcMASTER_INTERVAL : USINT := 0; (*start mode*)
mcMASTER_POSITION : UINT := 256; (*additional basis for movement profile (e.g. for MC_BR_Offset), StartMode for MC_BR_CrossCutterControl*)
mcMASTER_POSITION_BASED : UINT := 2; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
mcMAX_ACCELERATION_APPL : INT := 13; (*PLCopen motion parameter*)
mcMAX_ACCELERATION_SYSTEM : INT := 12; (*PLCopen motion parameter*)
mcMAX_DECELERATION_APPL : INT := 15; (*PLCopen motion parameter*)
mcMAX_DECELERATION_SYSTEM : INT := 14; (*PLCopen motion parameter*)
mcMAX_IV_TIME : USINT := 8; (*additional mode for power evaluation*)
mcMAX_JERK : INT := 16; (*PLCopen motion parameter*)
mcMAX_LOAD_SYSTEM : INT := 1015; (*PLCopen motion parameter*)
mcMAX_POSITION_CHANGE : INT := 1016; (*PLCopen motion parameter*)
mcMAX_POSITION_LAG : INT := 7; (*PLCopen motion parameter*)
mcMAX_SLAVE_COMP_DISTANCE_NEG : UINT := 4; (*mode for automat compensation check*)
mcMAX_SLAVE_COMP_DISTANCE_POS : UINT := 3; (*mode for automat compensation check*)
mcMAX_VELOCITY_APPL : INT := 9; (*PLCopen motion parameter*)
mcMAX_VELOCITY_SYSTEM : INT := 8; (*PLCopen motion parameter*)
mcMIDDLE : USINT := 5;
mcMIN_MASTER_COMP_DISTANCE : UINT := 2; (*mode for automat compensation check*)
mcMODIFIED_ACCEL_TRAPEZOID : UINT := 6; (*motion rule*)
mcMODIFIED_SINE_CURVE : UINT := 7; (*motion rule*)
mcMOTOR : UINT := 258; (*switch on simulation mode*)
mcMOVE_ACCELERATION_NEG : INT := 1005; (*PLCopen motion parameter*)
mcMOVE_ACCELERATION_POS : INT := 1003; (*PLCopen motion parameter*)
mcMOVE_CYCL_POS_IPL_MODE : INT := 1010; (*PLCopen motion parameter*)
mcMOVE_CYCL_VEL_IPL_MODE : INT := 1011; (*PLCopen motion parameter*)
mcMOVE_DECELERATION_NEG : INT := 1006; (*PLCopen motion parameter*)
mcMOVE_DECELERATION_POS : INT := 1004; (*PLCopen motion parameter*)
mcMOVE_VELOCITY_NEG : INT := 1002; (*PLCopen motion parameter*)
mcMOVE_VELOCITY_POS : INT := 1001; (*PLCopen motion parameter*)
mcMULTI_AXIS_TRACE : UDINT := 0; (*parameter trace type*)
mcN_EDGE : USINT := 1;
mcNEGATIVE_DIR : USINT := 1; (*movement direction*)
mcNET_TRACE_GLOBAL : UDINT := 0; (*network trace type*)
mcNETWORK_CYCLE_TIME: INT := 1017; (*PLCopen motion parameter*)
mcNO_CHANGE_COMP : USINT := 2;
mcNO_EVENTS : USINT := 253; (*event index*)
mcNO_STATES : USINT := 253;
mcNO_PARAMS : USINT := 253; (*parameter index*)
mcNO_POSITION : USINT := 0;
mcNO_START_COMP : USINT := 1;
mcNO_TEXT : UINT := 0; (*no error text determination active*)
mcNON_PERIODIC : BOOL := FALSE; (*cam profile mode*)
mcNOT_AXIS_RELATED : UDINT := 16#FFFFFFFF;
mcNULL : UINT := 1;
mcOFF : BOOL := FALSE;
mcON : BOOL := TRUE;
mcONCE : UINT := 1;
mcONE_RECORD : UINT := 0; (*mode for MC_BR_CyclicRead*)
mcONLY_EVENTS : USINT := 254; (*event index*)
mcONLY_PSM : USINT := 1; (*power evaluation mode*)
mcOPEN : USINT := 1;
mcOPTIMIZED_ACCELERATION : UINT := 768; (*interpolation rule*)
mcOPTIMIZED_VELOCITY : UINT := 512; (*interpolation rule*)
mcOUT_WINDOW : USINT := 30; (*trigger event mode*)
mcOVERRIDE : INT := 1000; (*PLCopen motion parameter*)
mcP_EDGE : USINT := 0;
mcPERIODIC : BOOL := TRUE; (*cam profile mode*)
mcPOSITION : USINT := 1; (*setup mode*)
mcPOSITIVE_DIR : USINT := 0; (*movement direction*)
mcQUADRATIC_PARABOLA : UINT := 2; (*motion rule*)
mcQUEUED : UINT := 1;
mcRELATIVE : USINT := 1; (*start mode*)
mcRELATIVE_NO_RESET : USINT := 3; (*start mode*)
mcRESET : UINT := 320; (*trace command*)
mcRESET_RING_STARTIDX : UINT := 4416; (*trace command (0x1000 + 0x0140)*)
mcRESTART : UINT := 273; (*StartMode for MC_BR_CrossCutterControl*)
mcREVERSE : UINT := 8;
mcSATURATION : USINT := 30; (*setup mode*)
mcSAVE : UINT := 341; (*trace command*)
mcSAVE_RING_STARTIDX : UINT := 4437; (*trace command (0x1000 + 0x0155)*)
mcSE : UINT := 3;
mcSET_OFFSET : USINT := 34; (*setup mode*)
mcSET_POSITION : UINT := 0; (*position source for MPDC*)
mcSHIFT_FROM_EXPECTED : UINT := 50; (*input for MC_BR_TouchProbe*)
mcSHIFT_FROM_RESULT : UINT := 49; (*input for MC_BR_TouchProbe*)
mcSHORTEST_WAY : USINT := 3; (*synchronization mode, movement direction*)
mcSIGNAL_CHIRP : UINT := 1; (*excitation signal type for controller setup*)
mcSIGNAL_CHIRP_TRAPEZOID : UINT := 2; (*excitation signal type for controller setup*)
mcSIGNAL_PRBS : UINT := 0; (*excitation signal type for controller setup*)
mcSIMPLE_SINE_CURVE : UINT := 3; (*motion rule*)
mcSIMULATION_INIT : UINT := 512; (*initialize simulation parameters*)
mcSIMULATION_OFF : UINT := 259; (*switch off simulation mode*)
mcSIMULATION_ON : UINT := 258; (*switch on simulation mode*)
mcSIMULATION_READ : UINT := 265; (*read calculated simulation parameters*)
mcSLAVE_POSITION : UINT := 0; (*additional basis for movement profile (e.g. for MC_BR_Offset)*)
mcSLOW_DOWN : USINT := 5; (*synchronization mode*)
mcSMALLER : UINT := 1;
mcSPEED : USINT := 2; (*setup mode*)
mcSTANDARD : USINT := 0; (*encoder count direction*)
mcSTART : UINT := 260;
mcSTART_N_FLANK : UINT := 128; (*start MPDC at negative flank*)
mcSTART_ONLY : USINT := 3; (*power evaluation mode*)
mcSTART_P_FLANK : UINT := 0; (*start MPDC at positive flank*)
mcSTEPPER : USINT := 31; (*setup mode*)
mcSTOP : UINT := 261;
mcSTOP_INDEX : INT := 1013; (*PLCopen motion parameter*)
mcSTRAIGHT_LINE : UINT := 1; (*motion rule*)
mcSW_END_ACTIVE : REAL := 0.0; (*SW end monitoring mode*)
mcSW_END_IGNORE : REAL := 1.0; (*SW end monitoring mode*)
mcSW_END_MONITORING : INT := 1014; (*PLCopen motion parameter*)
mcSW_END_SPF : REAL := 2.0; (*SW end monitoring mode*)
mcSW_LIMIT_NEG : INT := 3; (*PLCopen motion parameter*)
mcSW_LIMIT_POS : INT := 2; (*PLCopen motion parameter*)
mcSWITCH_OFF : UINT := 259; (*trace command*)
mcSWITCH_ON : UINT := 258; (*trace command*)
mcT_FILTER : UINT := 64; (*setup mode*)
mcT_FILTER_2 : UINT := 65; (*setup mode*)
mcTEST : UINT := 31; (*setup mode*)
mcTEXT : UINT := 1; (*error text determination active*)
mcTIME_BASED : UINT := 1; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
mcTIME_LIMIT : USINT := 8; (*enable time dependent switch off of function*)
mcTRACE_DELAY : USINT := 6; (*trace status*)
mcTRACE_FINISHED : USINT := 1; (*trace status*)
mcTRACE_REST : USINT := 5; (*trace status*)
mcTRACE_RING : USINT := 4; (*trace status*)
mcTRACE_STARTED : USINT := 20; (*trace status*)
mcTRACE_TIME : USINT := 2; (*trace status*)
mcTRACE_TRIGGER : USINT := 3; (*trace status*)
mcTRANSITION_OFF : UINT := 0;
mcTRANSITION_ON : UINT := 1;
mcTUNE_STANDSTILL : USINT := 0; (*constant for OperatingPoint*)
mcTUNE_TN : UINT := 16; (*setup mode*)
mcTUNE_V_CONSTANT : USINT := 1; (*constant for OperatingPoint*)
mcUNEQUAL : UINT := 5;
mcUPDATE_PERIOD : UINT := 16#8000; (*input for MC_BR_TouchProbe*)
mcUSE_AXIS_PERIOD : UINT := 16#4000; (*input for MC_BR_TouchProbe*)
mcUSE_FILTER_PAR : UINT := 4; (*setup mode *)
mcUSE_FIRST_TRIGGER_POS : UINT := 64; (*additional input for MC_BR_TouchProbe*)
mcUSE_STOP_COMP : USINT := 4;
mcUSE_TN : UINT := 8; (*setup mode*)
mcV_LIMIT_CALC : USINT := 4; (*recalculate speed limit depending on user setting*)
mcV_LIMIT_OFF : USINT := 2; (*disable speed limit*)
mcVELOCITY_CONTROL : UINT := 4; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
mcVERTICAL : USINT := 1; (*setup option for controller setup*)
mcWITH_PARAM : USINT := 2; (*power evaluation mode*)
mcWITHIN_PERIOD : USINT := 6; (*synchronization mode*)
mcWITHOUT_PERIOD : UINT := 4; (*input for MC_BR_TouchProbe*)
mcWITH_FF : USINT := 0; (*torque limit mode*)
mcWITHOUT_FF : USINT := 1; (*torque limit mode*)
mcWRAP : UINT := 2;
mcWRITE_DIRECT : UINT := 256; (*cyclic write mode*)
END_VAR

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.3.196?>
<Library Version="3.18.2" Description="Motion Control Manager" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>Acp10man.typ</File>
</Files>
<Dependencies>
<Dependency ObjectName="Acp10par" FromVersion="3.18.2" ToVersion="3.18.2" />
<Dependency ObjectName="Ncglobal" FromVersion="3.18.2" ToVersion="3.18.2" />
</Dependencies>
</Library>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.3.196?>
<Library Version="3.18.2" Description="ACOPOS Parameters" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>Acp10par.var</File>
</Files>
</Library>

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsARCfg
* File: AsARCfg.typ
* Author: B+R
********************************************************************
* Data types of library AsARCfg
********************************************************************)
TYPE
cfgLease_typ : STRUCT (*lease structure*)
name : STRING[8]; (*name of lease (max 8)*)
startAdr : STRING[16]; (*start address of lease*)
stopAdr : STRING[16]; (*stop address of lease*)
subnetMask : STRING[16]; (*subnet mask of lease*)
defaultGateway : STRING[16]; (*default gateway of lease*)
leaseTimeout : DINT; (*-1 for infinite timeout*)
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,94 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsARCfg
* File: AsARCfg.var
* Author: B+R
********************************************************************
* Local variables of library AsARCfg
********************************************************************)
VAR CONSTANT
cfgERR_DEVICE_NOT_EXIST : UINT := 29000; (*device doesn't exist or device not configured*)
cfgERR_DEVICE_INVALID : UINT := 29001; (*FBK "pDevice" parameter invalid (e.g. pDevice = 0)*)
cfgERR_OPTION_INVALID : UINT := 29002; (*FBK "Option" parameter invalid*)
cfgERR_VALUE_INVALID : UINT := 29003; (*invalid FBK parameter, error text depends on the function block*)
cfgERR_SET_NOT_POSSIBLE : UINT := 29004; (*not possible to set the subnet mask (e.g. DHCP client)*)
cfgERR_ARREG : UINT := 29005; (*error in the AR registry*)
cfgERR_INANODE_NOT_SUPPORTED : UINT := 29006; (*INA device does not support INA node numbers (e.g. IF1 = RS232)*)
cfgERR_FTP_SINIT : UINT := 29007; (*initialization error on FTP server*)
cfgERR_FTP_SDOWN : UINT := 29008; (*shutdown error on FTP server*)
cfgERR_PARAM_NOT_SET : UINT := 29009; (*default gateway not defined*)
cfgERR_SNTP_SERVER : UINT := 29010; (*could not start the SNTP server*)
cfgERR_SNTP_CLIENT : UINT := 29011; (*error starting SNTP client (e.g. client already running)*)
cfgERR_SNTP_INTERVAL : UINT := 29012; (*invalid FBK parameter - values from 1 to 60 are valid*)
cfgERR_SYSTEM : UINT := 29013; (*unexpected system error*)
cfgERR_TIMEZONE : UINT := 29014; (*invalid timezone specified*)
cfgERR_YEAR_INVALID : UINT := 29015; (*invalid year specified*)
cfgERR_CIFS_DOMAIN_INVALID : UINT := 29016; (*cifs domain name not defined *)
cfgERR_CIFS_DEFAULTUSER_INVALID : UINT := 29017; (*cifs defaultuser not defined *)
cfgERR_INANODE_NUMBER_SET : UINT := 29018; (*could not set the INA node number*)
cfgERR_CIFS_DEFAULTPW_INVALID : UINT := 29019; (*cifs default password not defined *)
cfgERR_DHCP_SERVER_STARTED : UINT := 29020; (*server is already working*)
cfgERR_INTERFACELIST_BUFFER : UINT := 29021; (*interfacelist buffer to small*)
cfgERR_LEASES_BUFFER : UINT := 29022; (*leases array to small*)
cfgERR_LEASE_EXISTS : UINT := 29023; (*leasename already exists*)
cfgERR_LEASE_TIMEOUT : UINT := 29024; (*invalid lease timeout*)
cfgERR_DHCP_CONFIG : UINT := 29025; (*DHCP server is not configured*)
cfgERR_SDM_FUNCTION_NOT_FOUND : UINT := 29026; (*used arsdm function was not found*)
cfgERR_CLEAR_NV_DATA : UINT := 29027; (*could not clear NV data*)
cfgERR_FUNCTION_NOT_FOUND : UINT := 29028; (*referenced function was not found*)
cfgERR_SDM_DISABLED : UINT := 29029; (*System diagnostics disabled*)
cfgERR_WEBSERV_DISABLED : UINT := 29030; (*Web Server disabled*)
cfgERR_DHCP_NO_DHCP_IP_OBTAINED : UINT := 29031; (*DHCP activated, but no IP obtained*)
cfgERR_NTP_SERVER : UINT := 29032; (*could not start the NTP server*)
cfgERR_NTP_CLIENT : UINT := 29033; (*error starting NTP client*)
cfgERR_ROUTE_TABLE : UINT := 29034; (*error updating network routing table*)
cfgETHBAUDRATE_AUTO : UDINT := 0; (*auto-detect*)
cfgETHBAUDRATE_10 : UDINT := 10; (*10 MBaud, half-duplex*)
cfgETHBAUDRATE_10FD : UDINT := 11; (*10 MBaud, full-duplex*)
cfgETHBAUDRATE_100 : UDINT := 100; (*100 MBaud, half-duplex*)
cfgETHBAUDRATE_100FD : UDINT := 101; (*100 MBaud, full-duplex*)
cfgETHBAUDRATE_1000FD : UDINT := 1001; (*1 GBaud, full-duplex*)
cfgOPTION_NON_VOLATILE : UDINT := 1; (*permanently sets parameters*)
cfgOPTION_VOLATILE : UDINT := 0; (*temporarily sets parameters*)
cfgCONFIGMODE_MANUALLY : UDINT := 0; (*manual configuration*)
cfgCONFIGMODE_DHCPCLIENT : UDINT := 1; (*DHCP client*)
cfgOPTION_DISABLE : UDINT := 0; (*disable*)
cfgOPTION_ENABLE : UDINT := 1; (*enable*)
cfgOPTION_WORKGROUP : USINT := 1; (*Domain is Workgroup*)
cfgOPTION_NON_WORKGROUP : USINT := 0; (*Domain isn't Workgroup*)
cfgOPTION_ENABLE_SDM : USINT := 1; (*enable sdm*)
cfgOPTION_DISABLE_SDM : USINT := 2; (*disable sdm*)
cfgSTATUS_SDM_ENABLED : USINT := 1; (*sdm is enabled*)
cfgSTATUS_SDM_DISABLED : USINT := 2; (*sdm is disabled*)
cfgWEB_MODE_GOFORM_DISABLE : UINT := 0; (*Webserver Goform disabled*)
cfgWEB_MODE_GOFORM_ENABLE : UINT := 1; (*Webserver Goform enabled*)
cfgWEB_MODE_GOFORM_NO_WRITE : UINT := 2; (*Webserver Goform readonly*)
cfgWEB_MODE_MIME_DEL : UINT := 0; (*Webserver delete MimeType*)
cfgWEB_MODE_MIME_ADD : UINT := 1; (*Webserver set MimeType*)
cfgWEB_MODE_DISABLED : UINT := 0; (*Webserver disabled*)
cfgWEB_MODE_ENABLED : UINT := 1; (*Webserver enabled*)
cfgOPTION_DNS_OFF : USINT := 0; (*disable DNS service*)
cfgOPTION_DNS_ON_CONFIG : USINT := 1; (*DNS service using the server address as configured*)
cfgOPTION_DNS_ON_DHCP : USINT := 2; (*Get the DNS address from the DHCP server*)
cfgNTP_START : UINT := 1; (*start NTP server/client*)
cfgNTP_STOP : UINT := 0; (*stop NTP server/client*)
cfgSTATUS_NTP_ACTIVE : UINT := 1; (*NTP server/client active*)
cfgSTATUS_NTP_INACTIVE : UINT := 0; (*NTP server/client inactive*)
cfgSDM_COLOR_DEFAULT : UDINT := 2147483648; (*sdm default color*)
END_VAR

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The AsARCfg library supports reading and writing Automation Runtime configurations." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsARCfg.fun</File>
<File>AsARCfg.typ</File>
<File>AsARCfg.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,204 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASARCFG_
#define _ASARCFG_
#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 cfgSTATUS_SDM_DISABLED 2U
#define cfgSTATUS_SDM_ENABLED 1U
#define cfgOPTION_DISABLE_SDM 2U
#define cfgOPTION_ENABLE_SDM 1U
#define cfgOPTION_NON_WORKGROUP 0U
#define cfgOPTION_WORKGROUP 1U
#define cfgOPTION_ENABLE 1U
#define cfgOPTION_DISABLE 0U
#define cfgCONFIGMODE_DHCPCLIENT 1U
#define cfgCONFIGMODE_MANUALLY 0U
#define cfgOPTION_VOLATILE 0U
#define cfgOPTION_NON_VOLATILE 1U
#define cfgETHBAUDRATE_1000FD 1001U
#define cfgETHBAUDRATE_100FD 101U
#define cfgETHBAUDRATE_100 100U
#define cfgETHBAUDRATE_10FD 11U
#define cfgETHBAUDRATE_10 10U
#define cfgETHBAUDRATE_AUTO 0U
#define cfgERR_CLEAR_NV_DATA 29027U
#define cfgERR_SDM_FUNCTION_NOT_FOUND 29026U
#define cfgERR_LEASE_TIMEOUT 29024U
#define cfgERR_LEASE_EXISTS 29023U
#define cfgERR_LEASES_BUFFER 29022U
#define cfgERR_INTERFACELIST_BUFFER 29021U
#define cfgERR_DHCP_SERVER_STARTED 29020U
#define cfgERR_CIFS_DEFAULTPW_INVALID 29019U
#define cfgERR_INANODE_NUMBER_SET 29018U
#define cfgERR_CIFS_DEFAULTUSER_INVALID 29017U
#define cfgERR_CIFS_DOMAIN_INVALID 29016U
#define cfgERR_YEAR_INVALID 29015U
#define cfgERR_TIMEZONE 29014U
#define cfgERR_SYSTEM 29013U
#define cfgERR_SNTP_INTERVAL 29012U
#define cfgERR_SNTP_CLIENT 29011U
#define cfgERR_SNTP_SERVER 29010U
#define cfgERR_PARAM_NOT_SET 29009U
#define cfgERR_FTP_SDOWN 29008U
#define cfgERR_FTP_SINIT 29007U
#define cfgERR_INANODE_NOT_SUPPORTED 29006U
#define cfgERR_ARREG 29005U
#define cfgERR_SET_NOT_POSSIBLE 29004U
#define cfgERR_VALUE_INVALID 29003U
#define cfgERR_OPTION_INVALID 29002U
#define cfgERR_DEVICE_INVALID 29001U
#define cfgERR_DEVICE_NOT_EXIST 29000U
#else
_IEC_CONST unsigned char cfgSTATUS_SDM_DISABLED = 2U;
_IEC_CONST unsigned char cfgSTATUS_SDM_ENABLED = 1U;
_IEC_CONST unsigned char cfgOPTION_DISABLE_SDM = 2U;
_IEC_CONST unsigned char cfgOPTION_ENABLE_SDM = 1U;
_IEC_CONST unsigned char cfgOPTION_NON_WORKGROUP = 0U;
_IEC_CONST unsigned char cfgOPTION_WORKGROUP = 1U;
_IEC_CONST unsigned long cfgOPTION_ENABLE = 1U;
_IEC_CONST unsigned long cfgOPTION_DISABLE = 0U;
_IEC_CONST unsigned long cfgCONFIGMODE_DHCPCLIENT = 1U;
_IEC_CONST unsigned long cfgCONFIGMODE_MANUALLY = 0U;
_IEC_CONST unsigned long cfgOPTION_VOLATILE = 0U;
_IEC_CONST unsigned long cfgOPTION_NON_VOLATILE = 1U;
_IEC_CONST unsigned long cfgETHBAUDRATE_1000FD = 1001U;
_IEC_CONST unsigned long cfgETHBAUDRATE_100FD = 101U;
_IEC_CONST unsigned long cfgETHBAUDRATE_100 = 100U;
_IEC_CONST unsigned long cfgETHBAUDRATE_10FD = 11U;
_IEC_CONST unsigned long cfgETHBAUDRATE_10 = 10U;
_IEC_CONST unsigned long cfgETHBAUDRATE_AUTO = 0U;
_IEC_CONST unsigned short cfgERR_CLEAR_NV_DATA = 29027U;
_IEC_CONST unsigned short cfgERR_SDM_FUNCTION_NOT_FOUND = 29026U;
_IEC_CONST unsigned short cfgERR_LEASE_TIMEOUT = 29024U;
_IEC_CONST unsigned short cfgERR_LEASE_EXISTS = 29023U;
_IEC_CONST unsigned short cfgERR_LEASES_BUFFER = 29022U;
_IEC_CONST unsigned short cfgERR_INTERFACELIST_BUFFER = 29021U;
_IEC_CONST unsigned short cfgERR_DHCP_SERVER_STARTED = 29020U;
_IEC_CONST unsigned short cfgERR_CIFS_DEFAULTPW_INVALID = 29019U;
_IEC_CONST unsigned short cfgERR_INANODE_NUMBER_SET = 29018U;
_IEC_CONST unsigned short cfgERR_CIFS_DEFAULTUSER_INVALID = 29017U;
_IEC_CONST unsigned short cfgERR_CIFS_DOMAIN_INVALID = 29016U;
_IEC_CONST unsigned short cfgERR_YEAR_INVALID = 29015U;
_IEC_CONST unsigned short cfgERR_TIMEZONE = 29014U;
_IEC_CONST unsigned short cfgERR_SYSTEM = 29013U;
_IEC_CONST unsigned short cfgERR_SNTP_INTERVAL = 29012U;
_IEC_CONST unsigned short cfgERR_SNTP_CLIENT = 29011U;
_IEC_CONST unsigned short cfgERR_SNTP_SERVER = 29010U;
_IEC_CONST unsigned short cfgERR_PARAM_NOT_SET = 29009U;
_IEC_CONST unsigned short cfgERR_FTP_SDOWN = 29008U;
_IEC_CONST unsigned short cfgERR_FTP_SINIT = 29007U;
_IEC_CONST unsigned short cfgERR_INANODE_NOT_SUPPORTED = 29006U;
_IEC_CONST unsigned short cfgERR_ARREG = 29005U;
_IEC_CONST unsigned short cfgERR_SET_NOT_POSSIBLE = 29004U;
_IEC_CONST unsigned short cfgERR_VALUE_INVALID = 29003U;
_IEC_CONST unsigned short cfgERR_OPTION_INVALID = 29002U;
_IEC_CONST unsigned short cfgERR_DEVICE_INVALID = 29001U;
_IEC_CONST unsigned short cfgERR_DEVICE_NOT_EXIST = 29000U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct cfgLease_typ
{ plcstring name[9];
plcstring startAdr[17];
plcstring stopAdr[17];
plcstring subnetMask[17];
plcstring defaultGateway[17];
signed long leaseTimeout;
} cfgLease_typ;
typedef struct CfgGetInaNode
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned char InaNode;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} CfgGetInaNode_typ;
typedef struct CfgGetIPAddr
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pIPAddr;
unsigned char Len;
/* 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;
} CfgGetIPAddr_typ;
typedef struct CfgGetSubnetMask
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pSubnetMask;
unsigned char Len;
/* 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;
} CfgGetSubnetMask_typ;
typedef struct CfgGetMacAddr
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pMacAddr;
unsigned char Len;
/* 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;
} CfgGetMacAddr_typ;
/* Prototyping of functions and function blocks */
void CfgGetInaNode(struct CfgGetInaNode* inst);
void CfgGetIPAddr(struct CfgGetIPAddr* inst);
void CfgGetSubnetMask(struct CfgGetSubnetMask* inst);
void CfgGetMacAddr(struct CfgGetMacAddr* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASARCFG_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,272 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASARCFG_
#define _ASARCFG_
#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 cfgSTATUS_SDM_DISABLED 2U
#define cfgSTATUS_SDM_ENABLED 1U
#define cfgOPTION_DISABLE_SDM 2U
#define cfgOPTION_ENABLE_SDM 1U
#define cfgOPTION_NON_WORKGROUP 0U
#define cfgOPTION_WORKGROUP 1U
#define cfgOPTION_ENABLE 1U
#define cfgOPTION_DISABLE 0U
#define cfgCONFIGMODE_DHCPCLIENT 1U
#define cfgCONFIGMODE_MANUALLY 0U
#define cfgOPTION_VOLATILE 0U
#define cfgOPTION_NON_VOLATILE 1U
#define cfgETHBAUDRATE_1000FD 1001U
#define cfgETHBAUDRATE_100FD 101U
#define cfgETHBAUDRATE_100 100U
#define cfgETHBAUDRATE_10FD 11U
#define cfgETHBAUDRATE_10 10U
#define cfgETHBAUDRATE_AUTO 0U
#define cfgERR_CLEAR_NV_DATA 29027U
#define cfgERR_SDM_FUNCTION_NOT_FOUND 29026U
#define cfgERR_LEASE_TIMEOUT 29024U
#define cfgERR_LEASE_EXISTS 29023U
#define cfgERR_LEASES_BUFFER 29022U
#define cfgERR_INTERFACELIST_BUFFER 29021U
#define cfgERR_DHCP_SERVER_STARTED 29020U
#define cfgERR_CIFS_DEFAULTPW_INVALID 29019U
#define cfgERR_INANODE_NUMBER_SET 29018U
#define cfgERR_CIFS_DEFAULTUSER_INVALID 29017U
#define cfgERR_CIFS_DOMAIN_INVALID 29016U
#define cfgERR_YEAR_INVALID 29015U
#define cfgERR_TIMEZONE 29014U
#define cfgERR_SYSTEM 29013U
#define cfgERR_SNTP_INTERVAL 29012U
#define cfgERR_SNTP_CLIENT 29011U
#define cfgERR_SNTP_SERVER 29010U
#define cfgERR_PARAM_NOT_SET 29009U
#define cfgERR_FTP_SDOWN 29008U
#define cfgERR_FTP_SINIT 29007U
#define cfgERR_INANODE_NOT_SUPPORTED 29006U
#define cfgERR_ARREG 29005U
#define cfgERR_SET_NOT_POSSIBLE 29004U
#define cfgERR_VALUE_INVALID 29003U
#define cfgERR_OPTION_INVALID 29002U
#define cfgERR_DEVICE_INVALID 29001U
#define cfgERR_DEVICE_NOT_EXIST 29000U
#else
_IEC_CONST unsigned char cfgSTATUS_SDM_DISABLED = 2U;
_IEC_CONST unsigned char cfgSTATUS_SDM_ENABLED = 1U;
_IEC_CONST unsigned char cfgOPTION_DISABLE_SDM = 2U;
_IEC_CONST unsigned char cfgOPTION_ENABLE_SDM = 1U;
_IEC_CONST unsigned char cfgOPTION_NON_WORKGROUP = 0U;
_IEC_CONST unsigned char cfgOPTION_WORKGROUP = 1U;
_IEC_CONST unsigned long cfgOPTION_ENABLE = 1U;
_IEC_CONST unsigned long cfgOPTION_DISABLE = 0U;
_IEC_CONST unsigned long cfgCONFIGMODE_DHCPCLIENT = 1U;
_IEC_CONST unsigned long cfgCONFIGMODE_MANUALLY = 0U;
_IEC_CONST unsigned long cfgOPTION_VOLATILE = 0U;
_IEC_CONST unsigned long cfgOPTION_NON_VOLATILE = 1U;
_IEC_CONST unsigned long cfgETHBAUDRATE_1000FD = 1001U;
_IEC_CONST unsigned long cfgETHBAUDRATE_100FD = 101U;
_IEC_CONST unsigned long cfgETHBAUDRATE_100 = 100U;
_IEC_CONST unsigned long cfgETHBAUDRATE_10FD = 11U;
_IEC_CONST unsigned long cfgETHBAUDRATE_10 = 10U;
_IEC_CONST unsigned long cfgETHBAUDRATE_AUTO = 0U;
_IEC_CONST unsigned short cfgERR_CLEAR_NV_DATA = 29027U;
_IEC_CONST unsigned short cfgERR_SDM_FUNCTION_NOT_FOUND = 29026U;
_IEC_CONST unsigned short cfgERR_LEASE_TIMEOUT = 29024U;
_IEC_CONST unsigned short cfgERR_LEASE_EXISTS = 29023U;
_IEC_CONST unsigned short cfgERR_LEASES_BUFFER = 29022U;
_IEC_CONST unsigned short cfgERR_INTERFACELIST_BUFFER = 29021U;
_IEC_CONST unsigned short cfgERR_DHCP_SERVER_STARTED = 29020U;
_IEC_CONST unsigned short cfgERR_CIFS_DEFAULTPW_INVALID = 29019U;
_IEC_CONST unsigned short cfgERR_INANODE_NUMBER_SET = 29018U;
_IEC_CONST unsigned short cfgERR_CIFS_DEFAULTUSER_INVALID = 29017U;
_IEC_CONST unsigned short cfgERR_CIFS_DOMAIN_INVALID = 29016U;
_IEC_CONST unsigned short cfgERR_YEAR_INVALID = 29015U;
_IEC_CONST unsigned short cfgERR_TIMEZONE = 29014U;
_IEC_CONST unsigned short cfgERR_SYSTEM = 29013U;
_IEC_CONST unsigned short cfgERR_SNTP_INTERVAL = 29012U;
_IEC_CONST unsigned short cfgERR_SNTP_CLIENT = 29011U;
_IEC_CONST unsigned short cfgERR_SNTP_SERVER = 29010U;
_IEC_CONST unsigned short cfgERR_PARAM_NOT_SET = 29009U;
_IEC_CONST unsigned short cfgERR_FTP_SDOWN = 29008U;
_IEC_CONST unsigned short cfgERR_FTP_SINIT = 29007U;
_IEC_CONST unsigned short cfgERR_INANODE_NOT_SUPPORTED = 29006U;
_IEC_CONST unsigned short cfgERR_ARREG = 29005U;
_IEC_CONST unsigned short cfgERR_SET_NOT_POSSIBLE = 29004U;
_IEC_CONST unsigned short cfgERR_VALUE_INVALID = 29003U;
_IEC_CONST unsigned short cfgERR_OPTION_INVALID = 29002U;
_IEC_CONST unsigned short cfgERR_DEVICE_INVALID = 29001U;
_IEC_CONST unsigned short cfgERR_DEVICE_NOT_EXIST = 29000U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct cfgLease_typ
{ plcstring name[9];
plcstring startAdr[17];
plcstring stopAdr[17];
plcstring subnetMask[17];
plcstring defaultGateway[17];
signed long leaseTimeout;
} cfgLease_typ;
typedef struct CfgGetInaNode
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned char InaNode;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} CfgGetInaNode_typ;
typedef struct CfgGetIPAddr
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pIPAddr;
unsigned char Len;
/* 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;
} CfgGetIPAddr_typ;
typedef struct CfgSetIPAddr
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pIPAddr;
unsigned long Option;
/* 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;
} CfgSetIPAddr_typ;
typedef struct CfgGetSubnetMask
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pSubnetMask;
unsigned char Len;
/* 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;
} CfgGetSubnetMask_typ;
typedef struct CfgSetSubnetMask
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pSubnetMask;
unsigned long Option;
/* 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;
} CfgSetSubnetMask_typ;
typedef struct CfgGetDefaultGateway
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pGateway;
unsigned char Len;
/* 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;
} CfgGetDefaultGateway_typ;
typedef struct CfgSetDefaultGateway
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pGateway;
unsigned long Option;
/* 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;
} CfgSetDefaultGateway_typ;
typedef struct CfgGetMacAddr
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pMacAddr;
unsigned char Len;
/* 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;
} CfgGetMacAddr_typ;
/* Prototyping of functions and function blocks */
void CfgGetInaNode(struct CfgGetInaNode* inst);
void CfgGetIPAddr(struct CfgGetIPAddr* inst);
void CfgSetIPAddr(struct CfgSetIPAddr* inst);
void CfgGetSubnetMask(struct CfgGetSubnetMask* inst);
void CfgSetSubnetMask(struct CfgSetSubnetMask* inst);
void CfgGetDefaultGateway(struct CfgGetDefaultGateway* inst);
void CfgSetDefaultGateway(struct CfgSetDefaultGateway* inst);
void CfgGetMacAddr(struct CfgGetMacAddr* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASARCFG_ */

View File

@@ -0,0 +1,89 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrString
* File: AsBrString.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library AsBrString
********************************************************************)
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsftoa : UINT (*converts a REAL value into a character string*)
VAR_INPUT
value :REAL; (*REAL (FLOAT) value to be converted into a character string*)
pString :UDINT; (*pointer to the destination character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatof : REAL (*converts a character string into a REAL (FLOAT) value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatod : LREAL (*converts a character string into a LREAL (DOUBLE) value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsitoa : UINT (*converts a DINT value into a character string*)
VAR_INPUT
value :DINT; (*numerical value to be converted into a string*)
pString :UDINT; (*pointer to the destination character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatoi : DINT (*converts a character string into a DINT value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemset : UDINT (*fills the memory area with specific values*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
value :USINT; (*initialization value*)
length :UDINT; (*number of bytes to be initialized*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcpy : UDINT (*copies the memory area*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
pSrc :UDINT; (*pointer to the data to be copied*)
length :UDINT; (*size of bytes to be copied*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemmove : UDINT (*copies the memory area (even if the memory areas overlap)*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
pSrc :UDINT; (*pointer to the data to be copied*)
length :UDINT; (*size of bytes to be copied*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcmp : DINT (*compares memory areas*)
VAR_INPUT
pMem1 :UDINT; (*pointer to the memory area 1*)
pMem2 :UDINT; (*pointer to the memory area 2*)
length :UDINT; (*size of bytes to be checked*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcat : UDINT (*attaches character strings to one another*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination character string*)
pSrc :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrlen : UDINT (*provides the length of a character string*)
VAR_INPUT
pString :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcpy : UDINT (*copies one character string into another*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination character string*)
pSrc :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcmp : DINT (*compares two character strings*)
VAR_INPUT
pString1 :UDINT; (*pointer to the first character string*)
pString2 :UDINT; (*pointer to the second character string*)
END_VAR
END_FUNCTION

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrStr
* File: AsBrStr.typ
* Author: B+R
********************************************************************
* Data types of library AsBrStr
********************************************************************)
TYPE
END_TYPE

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrStr
* File: AsBrStr.var
* Author: B+R
********************************************************************
* Local variables of library AsBrStr
********************************************************************)
VAR CONSTANT
END_VAR

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The AsBrStr Library contains FBKs for memory and character string handling." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsBrStr.fun</File>
<File>AsBrStr.typ</File>
<File>AsBrStr.var</File>
</Files>
</Library>

View File

@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Prototyping of functions and function blocks */
unsigned short brsftoa(float value, unsigned long pString);
float brsatof(unsigned long pString);
unsigned short brsitoa(signed long value, unsigned long pString);
signed long brsatoi(unsigned long pString);
unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
unsigned long brsstrlen(unsigned long pString);
unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

View File

@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Prototyping of functions and function blocks */
_BUR_PUBLIC unsigned short brsftoa(float value, unsigned long pString);
_BUR_PUBLIC float brsatof(unsigned long pString);
_BUR_PUBLIC double brsatod(unsigned long pString);
_BUR_PUBLIC unsigned short brsitoa(signed long value, unsigned long pString);
_BUR_PUBLIC signed long brsatoi(unsigned long pString);
_BUR_PUBLIC unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
_BUR_PUBLIC unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
_BUR_PUBLIC unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
_BUR_PUBLIC signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
_BUR_PUBLIC unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
_BUR_PUBLIC unsigned long brsstrlen(unsigned long pString);
_BUR_PUBLIC unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
_BUR_PUBLIC signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

View File

@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Prototyping of functions and function blocks */
unsigned short brsftoa(float value, unsigned long pString);
float brsatof(unsigned long pString);
unsigned short brsitoa(signed long value, unsigned long pString);
signed long brsatoi(unsigned long pString);
unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
unsigned long brsstrlen(unsigned long pString);
unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

View File

@@ -0,0 +1,80 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrWStr
* File: AsBrWStr.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library AsBrWStr
********************************************************************)
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsconv : UDINT (*converts one string to a different format*)
VAR_INPUT
pDestination :REFERENCE TO USINT; (*string to be appended to, given as a pointer*)
pSource :REFERENCE TO USINT; (*string to be appended, given as a pointer*)
level :USINT; (*brwU8toUC (= 0) if converting from U8 to UC; brwUCtoU8 (= 1) if converting from UC to U8*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncpy : UDINT (*copies a maximum of n characters from the pSource WC string to the pDestination address*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*pointer to the target memory for the string*)
pSource :REFERENCE TO UINT; (*string to be copied, given as a pointer*)
n :UDINT; (*max. number of characters to be copied*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncat : UDINT (*appends a maximum of n characters from the pSource string to the pDestination string*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*string to be appended to, given as a pointer*)
pSource :REFERENCE TO UINT; (*string to be appended, given as a pointer*)
n :UDINT; (*maximum number of characters to be added from pSource to pDestination*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscat : UDINT (*connects two WC strings to each other (concatenation)*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*string to be appended to, given as a pointer*)
pSource :REFERENCE TO UINT; (*string to be appended, given as a pointer*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscmp : DINT (*compares two 16-bit character strings*)
VAR_INPUT
pUcstr1 :REFERENCE TO UINT; (*first string, given as a pointer*)
pUcstr2 :REFERENCE TO UINT; (*second string, given as a pointer*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcslen : UDINT (*determines the length of a WC string*)
VAR_INPUT
pwcString :REFERENCE TO UINT; (*string whose length should be determined, given as a pointer*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsset : UDINT (*appends the pSource string to the pDestination string*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*string being written, given as a pointer*)
len :UDINT; (*number of characters to be written*)
symbol :UINT; (*character used to overwrite*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncmp : DINT (*compares two 16-bit strings*)
VAR_INPUT
pwcString1 :REFERENCE TO UINT; (*first string given as a pointer*)
pwcString2 :REFERENCE TO UINT; (*second string given as a pointer*)
n :UDINT; (*max. number of characters from pUcstr1 to be compared with pUcstr2*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscpy : UDINT (*copies a WC string*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*pointer to the target memory for the string*)
pSource :REFERENCE TO UINT; (*string to be copied, given as a pointer*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsrchr : UDINT (*searches for the last occurrence of a certain character in a WC string*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*character string being searched, given as a pointer*)
symbol :UINT; (*character being looked for*)
END_VAR
END_FUNCTION
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcschr : UDINT (*searches for the first occurrence of a certain character*)
VAR_INPUT
pDestination :REFERENCE TO UINT; (*string given as a pointer*)
symbol :UINT; (*character being looked for*)
END_VAR
END_FUNCTION

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrWStr
* File: AsBrWStr.typ
* Author: B+R
********************************************************************
* Data types of library AsBrWStr
********************************************************************)
TYPE
END_TYPE

View File

@@ -0,0 +1,14 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsBrWStr
* File: AsBrWStr.var
* Author: B+R
********************************************************************
* Local variables of library AsBrWStr
********************************************************************)
VAR CONSTANT
brwUCtoU8 : USINT := 1; (*instructs the wcsconv function to convert an ANSI character string into a WC string*)
brwU8toUC : USINT := 0; (*instructs the wcsconv function to convert a WC character string into an ANSI string*)
END_VAR

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The AsBrWStr library allows 8-bit character strings to be implemented for 16-bit WC (AsBrWStr) strings." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsBrWStr.fun</File>
<File>AsBrWStr.typ</File>
<File>AsBrWStr.var</File>
</Files>
</Library>

View File

@@ -0,0 +1,50 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRWSTR_
#define _ASBRWSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define brwUCtoU8 1U
#define brwU8toUC 0U
#else
_IEC_CONST unsigned char brwUCtoU8 = 1U;
_IEC_CONST unsigned char brwU8toUC = 0U;
#endif
/* Prototyping of functions and function blocks */
unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
unsigned long brwcslen(unsigned short* pwcString);
unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRWSTR_ */

View File

@@ -0,0 +1,52 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRWSTR_
#define _ASBRWSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define brwU8toUC 0U
#define brwUCtoU8 1U
#else
#ifndef _GLOBAL_CONST
#define _GLOBAL_CONST _WEAK const
#endif
_GLOBAL_CONST unsigned char brwU8toUC;
_GLOBAL_CONST unsigned char brwUCtoU8;
#endif
/* Prototyping of functions and function blocks */
_BUR_PUBLIC unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
_BUR_PUBLIC unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
_BUR_PUBLIC unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
_BUR_PUBLIC unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
_BUR_PUBLIC signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
_BUR_PUBLIC unsigned long brwcslen(unsigned short* pwcString);
_BUR_PUBLIC unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
_BUR_PUBLIC signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
_BUR_PUBLIC unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
_BUR_PUBLIC unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
_BUR_PUBLIC unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRWSTR_ */

View File

@@ -0,0 +1,50 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASBRWSTR_
#define _ASBRWSTR_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define brwUCtoU8 1U
#define brwU8toUC 0U
#else
_IEC_CONST unsigned char brwUCtoU8 = 1U;
_IEC_CONST unsigned char brwU8toUC = 0U;
#endif
/* Prototyping of functions and function blocks */
unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
unsigned long brwcslen(unsigned short* pwcString);
unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
#ifdef __cplusplus
};
#endif
#endif /* _ASBRWSTR_ */

View File

@@ -0,0 +1,79 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsIOAcc
* File: AsIOAcc.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library AsIOAcc
********************************************************************)
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsIOAccRead (*reads noncyclical register (only inputs); asynchronous execution*)
VAR_INPUT
enable :BOOL; (*enables execution*)
pDeviceName :UDINT; (*device name given as a pointer*)
pChannelName :UDINT; (*pointer to the channel name*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
value :UDINT; (*value read*)
END_VAR
VAR
intern :IOAC_I_TYPE; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsIOAccWrite (*writes noncyclical register (ONLY outputs); asynchronous execution*)
VAR_INPUT
enable :BOOL; (*enables execution*)
pDeviceName :UDINT; (*device name given as a pointer*)
pChannelName :UDINT; (*pointer to the channel name*)
value :UDINT; (*value to be written*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
intern :IOAC_I_TYPE; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsIOAccReadReg (*reads noncyclical register (SGC only); asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
nodeNr : USINT; (*node number of x2x module*)
registerNr : UINT; (*register number*)
size : USINT; (*register size*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
value : UDINT; (*regsiter value*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsIOAccWriteReg (*writes noncyclical register (SGC only); asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
nodeNr : USINT; (*node number of x2x module*)
registerNr : UINT; (*register number*)
size : USINT; (*register size*)
value : UDINT; (*new register value*)
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

View File

@@ -0,0 +1,24 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsIOAcc
* File: AsIOAcc.typ
* Author: B+R
********************************************************************
* Data types of library AsIOAcc
********************************************************************)
TYPE
IOAC_I_TYPE : STRUCT (*internal use*)
StateMan : UINT ;
ErrMan : UINT ;
Init : UDINT ;
Taskhandle : UDINT ;
Semaphore : UDINT ;
Requestsize : UDINT ;
Answersize : UDINT ;
pAccessObj : UDINT ;
Offset : UDINT ;
flags : UDINT ;
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,19 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsIOAcc
* File: AsIOAcc.var
* Author: B+R
********************************************************************
* Local variables of library AsIOAcc
********************************************************************)
VAR CONSTANT
ioacERR_INTERNAL : UINT := 30190; (*internal error*)
ioacERR_DEVICE : UINT := 30191; (*I/O module does not exist*)
ioacERR_CHANNEL : UINT := 30192; (*incorrect channel name specified*)
ioacERR_TIMEOUT : UINT := 30193; (*timeout reached*)
ioacERR_NOTSUPPORTED : UINT := 30194; (*not supported*)
ioacERR_PARAMETER : UINT := 30195; (*invalid parameter*)
ioacERR_ACCESS : UINT := 30196; (*access error*)
END_VAR

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="This library provides read and write access to non-cyclic I/O data points." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsIOAcc.fun</File>
<File>AsIOAcc.typ</File>
<File>AsIOAcc.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,132 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASIOACC_
#define _ASIOACC_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define ioacERR_ACCESS 30196U
#define ioacERR_PARAMETER 30195U
#define ioacERR_NOTSUPPORTED 30194U
#define ioacERR_TIMEOUT 30193U
#define ioacERR_CHANNEL 30192U
#define ioacERR_DEVICE 30191U
#define ioacERR_INTERNAL 30190U
#else
#ifndef _GLOBAL_CONST
#define _GLOBAL_CONST _WEAK const
#endif
_GLOBAL_CONST unsigned short ioacERR_ACCESS;
_GLOBAL_CONST unsigned short ioacERR_PARAMETER;
_GLOBAL_CONST unsigned short ioacERR_NOTSUPPORTED;
_GLOBAL_CONST unsigned short ioacERR_TIMEOUT;
_GLOBAL_CONST unsigned short ioacERR_CHANNEL;
_GLOBAL_CONST unsigned short ioacERR_DEVICE;
_GLOBAL_CONST unsigned short ioacERR_INTERNAL;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct IOAC_I_TYPE
{ unsigned short StateMan;
unsigned short ErrMan;
unsigned long Init;
unsigned long Taskhandle;
unsigned long Semaphore;
unsigned long Requestsize;
unsigned long Answersize;
unsigned long pAccessObj;
unsigned long Offset;
unsigned long flags;
} IOAC_I_TYPE;
typedef struct AsIOAccRead
{
/* VAR_INPUT (analog) */
unsigned long pDeviceName;
unsigned long pChannelName;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long value;
/* VAR (analog) */
struct IOAC_I_TYPE intern;
/* VAR_INPUT (digital) */
plcbit enable;
} AsIOAccRead_typ;
typedef struct AsIOAccWrite
{
/* VAR_INPUT (analog) */
unsigned long pDeviceName;
unsigned long pChannelName;
unsigned long value;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
struct IOAC_I_TYPE intern;
/* VAR_INPUT (digital) */
plcbit enable;
} AsIOAccWrite_typ;
typedef struct AsIOAccReadReg
{
/* VAR_INPUT (analog) */
unsigned char nodeNr;
unsigned short registerNr;
unsigned char size;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long value;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} AsIOAccReadReg_typ;
typedef struct AsIOAccWriteReg
{
/* VAR_INPUT (analog) */
unsigned char nodeNr;
unsigned short registerNr;
unsigned char size;
unsigned long value;
/* 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;
} AsIOAccWriteReg_typ;
/* Prototyping of functions and function blocks */
_BUR_PUBLIC void AsIOAccRead(struct AsIOAccRead* inst);
_BUR_PUBLIC void AsIOAccWrite(struct AsIOAccWrite* inst);
_BUR_PUBLIC void AsIOAccReadReg(struct AsIOAccReadReg* inst);
_BUR_PUBLIC void AsIOAccWriteReg(struct AsIOAccWriteReg* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASIOACC_ */

View File

@@ -0,0 +1,101 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASIOACC_
#define _ASIOACC_
#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 ioacERR_ACCESS 30196U
#define ioacERR_PARAMETER 30195U
#define ioacERR_NOTSUPPORTED 30194U
#define ioacERR_TIMEOUT 30193U
#define ioacERR_CHANNEL 30192U
#define ioacERR_DEVICE 30191U
#define ioacERR_INTERNAL 30190U
#else
_IEC_CONST unsigned short ioacERR_ACCESS = 30196U;
_IEC_CONST unsigned short ioacERR_PARAMETER = 30195U;
_IEC_CONST unsigned short ioacERR_NOTSUPPORTED = 30194U;
_IEC_CONST unsigned short ioacERR_TIMEOUT = 30193U;
_IEC_CONST unsigned short ioacERR_CHANNEL = 30192U;
_IEC_CONST unsigned short ioacERR_DEVICE = 30191U;
_IEC_CONST unsigned short ioacERR_INTERNAL = 30190U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct IOAC_I_TYPE
{ unsigned short StateMan;
unsigned short ErrMan;
unsigned long Init;
unsigned long Taskhandle;
unsigned long Semaphore;
unsigned long Requestsize;
unsigned long Answersize;
unsigned long pAccessObj;
unsigned long Offset;
unsigned long flags;
} IOAC_I_TYPE;
typedef struct AsIOAccReadReg
{
/* VAR_INPUT (analog) */
unsigned char nodeNr;
unsigned short registerNr;
unsigned char size;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long value;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} AsIOAccReadReg_typ;
typedef struct AsIOAccWriteReg
{
/* VAR_INPUT (analog) */
unsigned char nodeNr;
unsigned short registerNr;
unsigned char size;
unsigned long value;
/* 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;
} AsIOAccWriteReg_typ;
/* Prototyping of functions and function blocks */
void AsIOAccReadReg(struct AsIOAccReadReg* inst);
void AsIOAccWriteReg(struct AsIOAccWriteReg* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASIOACC_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsIecCon
* File: AsIecCon.typ
* Author: B+R
********************************************************************
* Data types of library AsIecCon
********************************************************************)
TYPE
END_TYPE

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsIecCon
* File: AsIecCon.var
* Author: B+R
********************************************************************
* Local variables of library AsIecCon
********************************************************************)
VAR CONSTANT
END_VAR

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.3.196?>
<Library Description="This library contains function interfaces for IEC 61131-3 conversion functions." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsIecCon.fun</File>
<File>AsIecCon.typ</File>
<File>AsIecCon.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="astime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,49 @@
/* Automation Studio Generated Header File, Format Version 1.00 */
/* do not change */
#ifndef ASIECCON_H_
#define ASIECCON_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <bur/plc.h>
/* Constants */
/* Datatypes */
/* Datatypes of function blocks */
/* Prototyping of functions and function blocks */
signed short H_TO_NINT(signed short IN);
unsigned short H_TO_NUINT(unsigned short IN);
signed long H_TO_NDINT(signed long IN);
unsigned long H_TO_NUDINT(unsigned long IN);
float H_TO_NREAL(float IN);
plctime H_TO_NTIME(plctime IN);
DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
signed short N_TO_HINT(signed short IN);
unsigned short N_TO_HUINT(unsigned short IN);
signed long N_TO_HDINT(signed long IN);
unsigned long N_TO_HUDINT(unsigned long IN);
float N_TO_HREAL(float IN);
plctime N_TO_HTIME(plctime IN);
DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
signed short swapINT(signed short IN);
unsigned short swapUINT(unsigned short IN);
signed long swapDINT(signed long IN);
unsigned long swapUDINT(unsigned long IN);
float swapREAL(float IN);
#ifdef __cplusplus
};
#endif
#endif /* ASIECCON_H_ */

View File

@@ -0,0 +1,61 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASIECCON_
#define _ASIECCON_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Prototyping of functions and function blocks */
_BUR_PUBLIC signed short H_TO_NINT(signed short IN);
_BUR_PUBLIC unsigned short H_TO_NUINT(unsigned short IN);
_BUR_PUBLIC signed long H_TO_NDINT(signed long IN);
_BUR_PUBLIC unsigned long H_TO_NUDINT(unsigned long IN);
_BUR_PUBLIC float H_TO_NREAL(float IN);
_BUR_PUBLIC double H_TO_NLREAL(double IN);
_BUR_PUBLIC plctime H_TO_NTIME(plctime IN);
_BUR_PUBLIC DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
_BUR_PUBLIC DATE H_TO_NDATE(DATE IN);
_BUR_PUBLIC TOD H_TO_NTOD(TOD IN);
_BUR_PUBLIC signed short N_TO_HINT(signed short IN);
_BUR_PUBLIC unsigned short N_TO_HUINT(unsigned short IN);
_BUR_PUBLIC signed long N_TO_HDINT(signed long IN);
_BUR_PUBLIC unsigned long N_TO_HUDINT(unsigned long IN);
_BUR_PUBLIC float N_TO_HREAL(float IN);
_BUR_PUBLIC double N_TO_HLREAL(double IN);
_BUR_PUBLIC plctime N_TO_HTIME(plctime IN);
_BUR_PUBLIC DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
_BUR_PUBLIC DATE N_TO_HDATE(DATE IN);
_BUR_PUBLIC TOD N_TO_HTOD(TOD IN);
_BUR_PUBLIC signed short swapINT(signed short IN);
_BUR_PUBLIC unsigned short swapUINT(unsigned short IN);
_BUR_PUBLIC WORD swapWORD(WORD IN);
_BUR_PUBLIC signed long swapDINT(signed long IN);
_BUR_PUBLIC unsigned long swapUDINT(unsigned long IN);
_BUR_PUBLIC DWORD swapDWORD(DWORD IN);
_BUR_PUBLIC TIME swapTIME(TIME IN);
_BUR_PUBLIC DATE_AND_TIME swapDT(DATE_AND_TIME IN);
_BUR_PUBLIC DATE swapDATE(DATE IN);
_BUR_PUBLIC TOD swapTOD(TOD IN);
_BUR_PUBLIC float swapREAL(float IN);
_BUR_PUBLIC double swapLREAL(double IN);
/* The interface declarations of the AsIecCon functions are not included here
* because they are inline in IEC languages. The x_TO_STRING and the
* STRING_TO_x functions are not available for C programms. */
#ifdef __cplusplus
};
#endif
#endif /* _ASIECCON_ */

View File

@@ -0,0 +1,62 @@
/* Automation Studio Generated Header File, Format Version 1.00 */
/* do not change */
#ifndef ASIECCON_H_
#define ASIECCON_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <bur/plc.h>
/* Constants */
/* Datatypes */
/* Datatypes of function blocks */
/* Prototyping of functions and function blocks */
signed short H_TO_NINT(signed short IN);
unsigned short H_TO_NUINT(unsigned short IN);
signed long H_TO_NDINT(signed long IN);
unsigned long H_TO_NUDINT(unsigned long IN);
float H_TO_NREAL(float IN);
plctime H_TO_NTIME(plctime IN);
DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
DATE H_TO_NDATE(DATE IN);
TOD H_TO_NTOD(TOD IN);
signed short N_TO_HINT(signed short IN);
unsigned short N_TO_HUINT(unsigned short IN);
signed long N_TO_HDINT(signed long IN);
unsigned long N_TO_HUDINT(unsigned long IN);
float N_TO_HREAL(float IN);
plctime N_TO_HTIME(plctime IN);
DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
DATE N_TO_HDATE(DATE IN);
TOD N_TO_HTOD(TOD IN);
signed short swapINT(signed short IN);
unsigned short swapUINT(unsigned short IN);
WORD swapWORD(WORD IN);
signed long swapDINT(signed long IN);
unsigned long swapUDINT(unsigned long IN);
DWORD swapDWORD(DWORD IN);
TIME swapTIME(TIME IN);
DATE_AND_TIME swapDT(DATE_AND_TIME IN);
DATE swapDATE(DATE IN);
TOD swapTOD(TOD IN);
float swapREAL(float IN);
/* The interface declarations of the AsIecCon functions are not included here
* because they are inline in IEC languages. The x_TO_STRING and the
* STRING_TO_x functions are not available for C programms. */
#ifdef __cplusplus
};
#endif
#endif /* ASIECCON_H_ */

View File

@@ -0,0 +1,313 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsSafety
* File: AsSafety.fun
* Author: B&R
* Created: May 25, 2012
********************************************************************
* Functions and function blocks of library AsSafety
********************************************************************)
{REDUND_ERROR} FUNCTION_BLOCK safeRemoteControl (*Remote Control Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
SafeLOGICStatus : RemoteControlStatusTypeV1; (*SafeLOGIC status*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
i_handle : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeRemoteControl_V2 (*Remote Control Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
SafeLOGICStatus : RemoteControlStatusTypeV2; (*SafeLOGIC status*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeDownloadApplication (*Download Application Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
ApplicationCRC : UDINT; (*application CRC*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
i_handle : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeDownloadApplication_V2 (*Download Application Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
ApplicationCRC : UDINT; (*application CRC*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeDownloadData (*Download Data Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
Timestamp : UDINT; (*timestamp from data*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
i_handle : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeDownloadData_V2 (*Download Data Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
Timestamp : UDINT; (*timestamp from data*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeConfigurationOnTarget (*Configuration On Target Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
Timestamp : UDINT; (*timestamp of data*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
i_handle : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeConfigurationOnTarget_V2 (*Configuration On Target Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
Timestamp : UDINT; (*timestamp of data*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION safeLibraryVersion : UINT (*returns the actual library version*)
END_FUNCTION
{REDUND_ERROR} FUNCTION_BLOCK safeDownloadFile (*Download File Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
Timestamp : UDINT; (*timestamp from data*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeCheckTable (*Check Table Function Block*)
VAR_INPUT
Execute : BOOL; (*execution*)
InstNr : USINT; (*instance number*)
pUser : UDINT; (*user name*)
Timestamp : UDINT; (*timestamp*)
TableType : USINT; (*table type*)
EntryCnt : UDINT; (*number of entries*)
pTableHeader : UDINT; (*table header input*)
pTableData : UDINT; (*table data input*)
pTableHeaderOut : UDINT; (*table header output buffer*)
pTableDataOut : UDINT; (*table data output buffer*)
pFileDataOut : UDINT; (*file data output buffer*)
AckData : USINT; (*1 .. acknowledge table data, 2 .. NOT acknowledge table data, abort FUB*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
CheckErrorCode : UDINT; (*table check error code*)
CheckErrorLine : UDINT; (*table check error line*)
CheckErrorColumn : UDINT; (*table check error column*)
pCrcOut : UDINT; (*returns pointer to CRC data*)
CrcCntOut : UDINT; (*returns number of CRCs*)
END_VAR
VAR
i_step : UINT; (*internal*)
i_tmp : UDINT; (*internal*)
i_clean : BOOL; (*internal*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeFileInfo (*File Info Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,...*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION safeGetTableLength : UDINT (*Function returns size of table data*)
VAR_INPUT
TableType : USINT; (*table type*)
EntryCnt : UDINT; (*number of entries*)
pTableHeader : UDINT; (*pointer to table header*)
END_VAR
END_FUNCTION
{REDUND_ERROR} FUNCTION_BLOCK safeGetDataLength (*Function Block returns size of download file*)
VAR_INPUT
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
Length : UDINT; (*calculated length of download file*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeCreateData (*Create Data Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeDATA_TYPE_MAOP, safeDATA_TYPE_EXTMAOP,... *)
pCommandData : UDINT; (*pointer to command data*)
FileDataOutLen : UDINT; (*size of buffer for file data*)
pFileDataOut : UDINT; (*pointer to memory buffer for file data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
UnlockRequired : BOOL; (*unlock required*)
Timestamp : UDINT; (*timestamp from data*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_ERROR} FUNCTION_BLOCK safeLogicInfo (*Remote Control Function Block*)
VAR_INPUT
SafeLOGICID : UINT; (*SafeLOGIC ID*)
Execute : BOOL; (*execution*)
Type : UINT; (*type of data: safeINFO_TYPE_PWD_INFO, safeINFO_TYPE_PWD_CHK, safeINFO_TYPE_UDID_INFO*)
pCommandData : UDINT; (*pointer to command data*)
END_VAR
VAR_OUTPUT
Done : BOOL; (*execution done*)
Busy : BOOL; (*execution busy*)
Error : BOOL; (*execution error*)
StatusID : UINT; (*execution status: ERR_OK, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
Internal : AsSafetyInternalType; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK

View File

@@ -0,0 +1,578 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsSafety
* File: AsSafety.typ
* Author: B&R
* Created: May 25, 2012
********************************************************************
* Data types of library AsSafety
********************************************************************)
TYPE
FileReferenceType : STRUCT (*file reference*)
Device : STRING[80]; (*pointer to the device name*)
File : STRING[80]; (*pointer to the file name*)
END_STRUCT;
AsSafetyInternalType : STRUCT (*internal data type*)
Clean : BOOL;
State : UINT;
Result : UINT;
Tmp : UDINT;
pThis : UDINT;
pFcn : UDINT;
END_STRUCT;
SourceLocalDataTypeV1 : STRUCT (*local data source type*)
pFileData : UDINT; (*pointer to data buffer*)
FileLength : UDINT; (*data length*)
END_STRUCT;
SourceLocalFileTypeV1 : STRUCT (*local file source*)
SourceFile : FileReferenceType; (*path to local file*)
END_STRUCT;
DataSourceTypeV1 : STRUCT (*source data type*)
Type : UINT; (*0 .. file upload from safeLOGIC, 1 .. local data buffer, 2 .. local file*)
LocalData : SourceLocalDataTypeV1; (*arguments for local data*)
LocalFile : SourceLocalFileTypeV1; (*arguments for local file*)
END_STRUCT;
InfoCmdPwdInfoTypeV1 : STRUCT (*password info data from SafeLOGIC command structure*)
Version : UINT; (*used version*)
PasswordSet : BOOL; (*0 .. no password set, 1 .. password is set*)
END_STRUCT;
InfoCmdPwdChkTypeV1 : STRUCT (*password check data from SafeLOGIC command structure*)
Version : UINT; (*used version*)
Password : STRING[16]; (*password for check*)
PasswordEqual : BOOL; (*0 .. no password set, 1 .. password is set*)
END_STRUCT;
ConfigurationAddParaTypeV2 : STRUCT (*additional parameter data from SafeLOGIC*)
SADR : UINT; (*safety address*)
ID : USINT; (*id*)
pParaData : UDINT; (*pointer to additional parameter data*)
Length : UDINT; (*size of parameter buffer*)
LengthOut : UDINT; (*length of parameter*)
CRC : UDINT; (*CRC*)
Timestamp : UDINT; (*timestamp*)
END_STRUCT;
ConfigurationAddParaTypeV1 : STRUCT (*additional parameter data from SafeLOGIC*)
SADR : UINT; (*safety address*)
ID : USINT; (*id*)
pParaData : UDINT; (*pointer to additional parameter data*)
Length : UDINT; (*size of parameter buffer*)
CRC : UDINT; (*CRC*)
Timestamp : UDINT; (*timestamp*)
END_STRUCT;
ConfigurationBitOptionsTypeV1 : STRUCT (*bit machine options*)
BitData : ARRAY[0..63]OF USINT; (*bit array*)
END_STRUCT;
ConfigurationCmdAddParaTypeV2 : STRUCT (*additional parameter data from SafeLOGIC command structure*)
Version : UINT; (*input data: used version*)
Password : STRING[16]; (*input data: password*)
pParaDataOutput : UDINT; (*input data: pointer to list of type ConfigurationAddParaTypeV2*)
NumberParaSetsOutput : UINT; (*input data: number of available entries in pParaDataOutput*)
NumberParaSetsOutputOut : UINT; (*return value: number of returned entries*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
ConfigurationCmdAddParaTypeV1 : STRUCT (*additional parameter data from SafeLOGIC command structure*)
Version : UINT; (*input data: used version*)
Password : STRING[16]; (*input data: password*)
pParaDataOutput : UDINT; (*return value: pointer to list of type ConfigurationAddParaTypeV1*)
NumberParaSetsOutput : UINT; (*return value: number of returned entries*)
END_STRUCT;
ConfigurationCmdExtMaOpTypeV2 : STRUCT (*extended machine options from SafeLOGIC command structure*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
pIntDataOutput : UDINT; (*input data: pointer to list of type ConfigurationIntOptionsTypeV1*)
NumberIntOutput : UINT; (*input data: number of available entries in INT buffer*)
NumberIntOutputOut : UINT; (*return value: number of returned INT data entries*)
pUintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationUintOptionsTypeV1*)
NumberUintOutput : UINT; (*input data: number of available entries in UINT buffer*)
NumberUintOutputOut : UINT; (*return value: number of returned UINT data entries*)
pDintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationDintOptionsTypeV1*)
NumberDintOutput : UINT; (*input data: number of available DINT data entries*)
NumberDintOutputOut : UINT; (*return value: number of returned DINT data entries*)
pUdintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationUdintOptionsTypeV1*)
NumberUdintOutput : UINT; (*input data: number of available UDINT data entries*)
NumberUdintOutputOut : UINT; (*return value: number of returned UDINT data entries*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
ConfigurationCmdExtMaOpTypeV1 : STRUCT (*extended machine options from SafeLOGIC command structure*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
pIntDataOutput : UDINT; (*return value: pointer to list of type ConfigurationIntOptionsTypeV1*)
NumberIntOutput : UINT; (*return value: number of returned INT data entries*)
pUintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationUintOptionsTypeV1*)
NumberUintOutput : UINT; (*return value: number of returned UINT data entries*)
pDintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationDintOptionsTypeV1*)
NumberDintOutput : UINT; (*return value: number of returned DINT data entries*)
pUdintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationUdintOptionsTypeV1*)
NumberUdintOutput : UINT; (*return value: number of returned UDINT data entries*)
END_STRUCT;
ConfigurationCmdMaOpTypeV2 : STRUCT (*machine options from SafeLOGIC command structure Version 2*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
pDeviceListOutput : UDINT; (*input data: pointer to device list buffer of type ConfigurationDeviceTypeV1*)
NumberDevicesOutput : UINT; (*input data: number of available device entries in devices list buffer*)
NumberDevicesOutputOut : UINT; (*return value: number of returned device entries*)
pMachineOptionsOutput : UDINT; (*input data: pointer to bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsOutput : UDINT; (*input data: pointer to module flags of type ConfigurationModuleFlagsTypeV1*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
ConfigurationCmdMaOpTypeV1 : STRUCT (*machine options from SafeLOGIC command structure Version 1*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
pDeviceListOutput : UDINT; (*return value: pointer to device list of type ConfigurationDeviceTypeV1*)
NumberDevicesOutput : UINT; (*return value: number of returned entries*)
pMachineOptionsOutput : UDINT; (*return value: pointer to bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsOutput : UDINT; (*return value: pointer to module flags of type ConfigurationModuleFlagsTypeV1*)
END_STRUCT;
ConfigurationCmdTableTypeV2 : STRUCT (*table data from SafeLOGIC command structure*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
pTableDataOutput : UDINT; (*input data: pointer to list of type ConfigurationTableTypeV1*)
NumberTablesOutput : UINT; (*input data: number of available entries in pTableDataOutput*)
NumberTablesOutputOut : UINT; (*return value: number of returned table entries*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
ConfigurationCmdTableTypeV1 : STRUCT (*table data from SafeLOGIC command structure*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
pTableDataOutput : UDINT; (*return value: pointer to list of type ConfigurationTableTypeV1*)
NumberTablesOutput : UINT; (*return value: number of returned table entries*)
END_STRUCT;
FileInfoCmdTypeV1 : STRUCT (*file info command structure*)
Version : UINT; (*used version*)
DataSource : DataSourceTypeV1; (*data source*)
Timestamp : UDINT; (*timestamp*)
pCrcs : UDINT; (*buffer for CRCs*)
NumberOfCrcs : UINT; (*size of CRC buffer*)
NumberOfCrcsOut : UINT; (*number of CRCs*)
END_STRUCT;
ConfigurationDeviceTypeV1 : STRUCT (*safety device from SafeLOGIC*)
SADR : UINT; (*safety address*)
UDID : ARRAY[0..5]OF USINT; (*UDID*)
END_STRUCT;
ConfigurationDintOptionsTypeV1 : STRUCT (*DINT machine options*)
ID : UINT; (*id*)
Value : DINT; (*value*)
END_STRUCT;
ConfigurationIntOptionsTypeV1 : STRUCT (*INT machine options*)
ID : UINT; (*id*)
Value : INT; (*value*)
END_STRUCT;
ConfigurationModuleFlagsTypeV1 : STRUCT (*module flags*)
Optional : ARRAY[0..127]OF USINT; (*optional*)
Startup : ARRAY[0..127]OF USINT; (*startup*)
NotPresent : ARRAY[0..127]OF USINT; (*not present*)
END_STRUCT;
ConfigurationTableTypeV2 : STRUCT (*table data for command struct V1*)
ID : UINT; (*table id*)
Type : USINT; (*table type*)
NumberOfCRCs : UINT; (*input data: number of available entries in pCRCData*)
NumberOfCRCsOut : UINT; (*return value: number of returned CRC entries*)
pCRCData : UDINT; (*input data: pointer to table CRC buffer*)
END_STRUCT;
ConfigurationTableTypeV1 : STRUCT (*table data for command struct V2*)
ID : UINT; (*table id*)
Type : USINT; (*table type*)
NumberOfCRCs : UINT; (*return value: number of returned CRCs*)
pCRCData : UDINT; (*return value: pointer to table CRC buffer*)
END_STRUCT;
ConfigurationUdintOptionsTypeV1 : STRUCT (*UDINT machine options*)
ID : UINT; (*id*)
Value : UDINT; (*value*)
END_STRUCT;
ConfigurationUintOptionsTypeV1 : STRUCT (*UINT machine options*)
ID : UINT; (*id*)
Value : UINT; (*value*)
END_STRUCT;
DownloadAcknExtMaOpTypeV1 : STRUCT (*acknowledge extended machine options structure*)
AcknIntOptions : ARRAY[0..63]OF BOOL; (*acknowledge INT*)
AcknUintOptions : ARRAY[0..63]OF BOOL; (*acknowledge UINT*)
AcknDintOptions : ARRAY[0..63]OF BOOL; (*acknowledge DINT*)
AcknUdintOptions : ARRAY[0..63]OF BOOL; (*acknowledge UDINT*)
END_STRUCT;
DownloadAcknMaOpTypeV1 : STRUCT (*acknowledge bit machine options structure*)
AcknBitOptions : ARRAY[0..63]OF USINT; (*acknowledge bit*)
END_STRUCT;
DownloadAcknAddParaTypeV1 : STRUCT (*acknowledge bit additional parameter*)
AcknBitAddPara : ARRAY[0..63]OF USINT; (*acknowledge bit*)
END_STRUCT;
DownloadCmdAddParaTypeV2 : STRUCT (*additional paramater command structure*)
Version : UINT; (*input data: used version*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pParaListInput : UDINT; (*input data: pointer to additional parameter input data list of type DownloadAddParaTypeV1*)
NumberParaSetsInput : UINT; (*input data: number of input parameter entries in pParaListInput*)
pParaDataOutput : UDINT; (*input data: pointer to list of type ConfigurationAddParaTypeV2*)
NumberParaSetsOutput : UINT; (*input data: number of available entries in pParaDataOutput*)
NumberParaSetsOutputOut : UINT; (*return value: number of returned entries*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
DownloadCmdAddParaTypeV1 : STRUCT (*additional paramater command structure*)
Version : UINT; (*input data: used version*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pParaListInput : UDINT; (*input data: pointer to additional parameter input data list of type DownloadAddParaTypeV1*)
NumberParaSetsInput : UINT; (*input data: number of input parameter entries in pParaListInput*)
pParaDataOutput : UDINT; (*return value: pointer to list of type ConfigurationAddParaTypeV1*)
NumberParaSetsOutput : UINT; (*return value: number of returned entries*)
END_STRUCT;
DownloadCmdApplicationTypeV1 : STRUCT (*application command structure*)
Version : UINT; (*used version*)
Password : STRING[16]; (*password*)
UDID_Low : UDINT; (*UDID low*)
UDID_High : UINT; (*UDID high*)
ApplicationID : UINT; (*application id*)
Device : STRING[80]; (*device for file*)
File : STRING[80]; (*file name*)
Unlock : USINT; (*unlock application*)
END_STRUCT;
DownloadCmdExtMaOpTypeV2 : STRUCT (*extended machine options command structure*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pIntDataInput : UDINT; (*input data: pointer to INT input data list from type ConfigurationIntOptionsTypeV1*)
NumberIntInput : UINT; (*input data: number of INT input entries in pIntDataInput*)
pUintDataInput : UDINT; (*input data: pointer to UINT input data list from type ConfigurationUintOptionsTypeV1*)
NumberUintInput : UINT; (*input data: number of UINT input entries in pUintDataInput*)
pDintDataInput : UDINT; (*input data: pointer to DINT input data list from type ConfigurationDintOptionsTypeV1*)
NumberDintInput : UINT; (*input data: number of DINT input entries in pDintDataInput*)
pUdintDataInput : UDINT; (*input data: pointer to UDINT input data list from type ConfigurationUdintOptionsTypeV1*)
NumberUdintInput : UINT; (*input data: number of UDINT input entries in pUdintDataInput*)
pAcknMachineOptions : UDINT; (*input data: pointer to acknowledge information of type DownloadAcknMaOpTypeV1*)
pIntDataOutput : UDINT; (*input data: pointer to list of type ConfigurationIntOptionsTypeV1*)
NumberIntOutput : UINT; (*input data: number of available entries in INT buffer*)
NumberIntOutputOut : UINT; (*return value: number of returned INT data entries*)
pUintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationUintOptionsTypeV1*)
NumberUintOutput : UINT; (*input data: number of available entries in UINT buffer*)
NumberUintOutputOut : UINT; (*return value: number of returned UINT data entries*)
pDintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationDintOptionsTypeV1*)
NumberDintOutput : UINT; (*input data: number of available DINT data entries*)
NumberDintOutputOut : UINT; (*return value: number of returned DINT data entries*)
pUdintDataOutput : UDINT; (*input data: pointer to list of type ConfigurationUdintOptionsTypeV1*)
NumberUdintOutput : UINT; (*input data: number of available UDINT data entries*)
NumberUdintOutputOut : UINT; (*number of UDINT channels from SafeLOGIC*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
DownloadCmdExtMaOpTypeV1 : STRUCT (*return value: number of returned UDINT data entries*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pIntDataInput : UDINT; (*input data: pointer to INT input data list from type ConfigurationIntOptionsTypeV1*)
NumberIntInput : UINT; (*input data: number of INT input entries in pIntDataInput*)
pUintDataInput : UDINT; (*input data: pointer to UINT input data list from type ConfigurationUintOptionsTypeV1*)
NumberUintInput : UINT; (*input data: number of UINT input entries in pUintDataInput*)
pDintDataInput : UDINT; (*input data: pointer to DINT input data list from type ConfigurationDintOptionsTypeV1*)
NumberDintInput : UINT; (*input data: number of DINT input entries in pDintDataInput*)
pUdintDataInput : UDINT; (*input data: pointer to UDINT input data list from type ConfigurationUdintOptionsTypeV1*)
NumberUdintInput : UINT; (*input data: number of UDINT input entries in pUdintDataInput*)
pAcknMachineOptions : UDINT; (*input data: pointer to acknowledge information of type DownloadAcknMaOpTypeV1*)
pIntDataOutput : UDINT; (*return value: pointer to list of type ConfigurationIntOptionsTypeV1*)
NumberIntOutput : UINT; (*return value: number of returned INT data entries*)
pUintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationUintOptionsTypeV1*)
NumberUintOutput : UINT; (*return value: number of returned UINT data entries*)
pDintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationDintOptionsTypeV1*)
NumberDintOutput : UINT; (*return value: number of returned DINT data entries*)
pUdintDataOutput : UDINT; (*return value: pointer to list of type ConfigurationUdintOptionsTypeV1*)
NumberUdintOutput : UINT; (*return value: number of returned UDINT data entries*)
END_STRUCT;
DownloadCmdMaOpTypeV2 : STRUCT (*machine options command structure*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low from SafeLOGIC*)
UDID_High : UINT; (*input data: UDID high from SafeLOGIC*)
Unlock : USINT; (*input data: unlock data*)
pDeviceListInput : UDINT; (*input data: pointer to input device list of type DownloadDeviceTypeV1*)
NumberDevicesInput : UINT; (*input data: number of input devices*)
pMachineOptionsInput : UDINT; (*input data: pointer to input bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsInput : UDINT; (*input data: pointer to input module flags of type ConfigurationModuleFlagsTypeV1*)
pAcknMachineOptions : UDINT; (*input data: pointer to acknowledge information of type DownloadAcknMaOpTypeV1*)
pDeviceListOutput : UDINT; (*input data: pointer to device list buffer of type ConfigurationDeviceTypeV1*)
NumberDevicesOutput : UINT; (*input data: number of available device entries in devices list buffer*)
NumberDevicesOutputOut : UINT; (*return value: number of returned device entries*)
pMachineOptionsOutput : UDINT; (*input data: pointer to bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsOutput : UDINT; (*input data: pointer to module flags of type ConfigurationModuleFlagsTypeV1*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
DownloadCmdMaOpTypeV1 : STRUCT (*machine options command structure*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low from SafeLOGIC*)
UDID_High : UINT; (*input data: UDID high from SafeLOGIC*)
Unlock : USINT; (*input data: unlock data*)
pDeviceListInput : UDINT; (*input data: pointer to input device list of type DownloadDeviceTypeV1*)
NumberDevicesInput : UINT; (*input data: number of input devices*)
pMachineOptionsInput : UDINT; (*input data: pointer to input bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsInput : UDINT; (*input data: pointer to input module flags of type ConfigurationModuleFlagsTypeV1*)
pAcknMachineOptions : UDINT; (*input data: pointer to acknowledge information of type DownloadAcknMaOpTypeV1*)
pDeviceListOutput : UDINT; (*return value: pointer to device list of type ConfigurationDeviceTypeV1*)
NumberDevicesOutput : UINT; (*return value: number of returned entries*)
pMachineOptionsOutput : UDINT; (*return value: pointer to bit machine options of type ConfigurationBitOptionsTypeV1*)
pModuleFlagsOutput : UDINT; (*return value: pointer to module flags of type ConfigurationModuleFlagsTypeV1*)
END_STRUCT;
DownloadCmdTableTypeV2 : STRUCT (*table command structure*)
Version : UINT; (*input data: safeVERSION_R110*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pTableDataInput : UDINT; (*input data: pointer to input table data list of type DownloadTableTypeV2*)
NumberTablesInput : UINT; (*input data: number of input entries in pTableDataInput*)
pTableDataOutput : UDINT; (*input data: pointer to list of type ConfigurationTableTypeV1*)
NumberTablesOutput : UINT; (*input data: number of available entries in pTableDataOutput*)
NumberTablesOutputOut : UINT; (*return value: number of returned table entries*)
pBackupFile : UDINT; (*input data: 0 .. no backup, otherwise pointer to struct of type FileReferenceType *)
pXmlOutputFile : UDINT; (*input data: 0 .. don't create XML output data, otherwise pointer to struct of type FileReferenceType*)
END_STRUCT;
DownloadCmdTableTypeV1 : STRUCT (*table command structure*)
Version : UINT; (*input data: safeVERSION_R107*)
Password : STRING[16]; (*input data: password*)
UDID_Low : UDINT; (*input data: UDID low*)
UDID_High : UINT; (*input data: UDID high*)
Unlock : USINT; (*input data: unlock data*)
pTableDataInput : UDINT; (*input data: pointer to input table data list of type DownloadTableTypeV1*)
NumberTablesInput : UINT; (*input data: number of input entries in pTableDataInput*)
pTableDataOutput : UDINT; (*return value: pointer to list of type ConfigurationTableTypeV1*)
NumberTablesOutput : UINT; (*return value: number of returned table entries*)
END_STRUCT;
DownloadCmdFileTypeV1 : STRUCT (*file command structure*)
Version : UINT; (*used version*)
Password : STRING[16]; (*password*)
UDID_Low : UDINT; (*UDID low*)
UDID_High : UINT; (*UDID high*)
Unlock : USINT; (*unlock data*)
DataSource : DataSourceTypeV1; (*local data or local file available, file upload from safeLOGIC not available*)
pCrcs : UDINT; (*pointer to CRC data buffer*)
NumberOfCrcs : UINT; (*size of CRC data Buffer*)
NumberOfCrcsOut : UINT; (*number of CRCs*)
END_STRUCT;
DownloadAddParaTypeV1 : STRUCT (*additional parameter data*)
SADR : UINT; (*safety address*)
ID : USINT; (*id*)
pParaData : UDINT; (*pointer to additional parameter data*)
Length : UDINT; (*length*)
pAcknAddPara : UDINT; (*pointer to acknowledge information*)
END_STRUCT;
DownloadDeviceTypeV1 : STRUCT (*safety device*)
SADR : UINT; (*safety address*)
UDID_Low : UDINT; (*UDID low*)
UDID_High : UINT; (*UDID high*)
END_STRUCT;
DownloadTableTypeV1 : STRUCT (*table data*)
Device : STRING[80]; (*device for file*)
File : STRING[80]; (*file name*)
END_STRUCT;
DownloadTableTypeV2 : STRUCT (*table data*)
Type : UINT; (*safeTABLE_FILE_TYPE .. use Device / File, safeTABLE_DATA_TYPE .. use pData / DataLen*)
Device : STRING[80]; (*device for file*)
File : STRING[80]; (*file name*)
pData : UDINT; (*pointer to table data *)
DataLen : UDINT; (*length of table data*)
END_STRUCT;
RemoteControlCmdTypeV1 : STRUCT (*remote control command structure*)
Version : UINT; (*used version*)
Command : UINT; (*command*)
Number : UINT; (*actual number*)
Data : UINT; (*data*)
Password : STRING[16]; (*password*)
NewPassword : STRING[16]; (*new password*)
END_STRUCT;
RemoteControlStatusTypeV1 : STRUCT (*remote control status from SafeLOGIC*)
Command : UINT; (*last received command*)
Number : UINT; (*running number of last received command*)
Status : UINT; (*status of command*)
State : UINT; (*state of the last ENTER command*)
EnterData : UINT; (*last received ENTER command that was correct executed*)
EnterNumber : UINT; (*running number of the last received ENTER command*)
EnterExecuteStatus : UINT; (*state of the last received ENTER command*)
SafeOSState : USINT; (*status of the safety application*)
SafeKEYChanged : USINT; (*SafeKEY has been exchanged*)
LedTestActive : USINT; (*LED test active*)
Scanning : USINT; (*module scan active*)
openSAFETYstate : USINT; (*status of openSAFETY stack*)
FailSafe : USINT; (*Fail-Safe status*)
NumberOfMissingModules : UINT; (*number of missing modules*)
NumberOfUDIDMismatches : UINT; (*number of mismatched modules*)
NumberOfDifferentFirmware : UINT; (*number of modules with different firmware*)
SADR : ARRAY[0..100]OF UINT; (*safety address array*)
MissingModules : ARRAY[0..15]OF USINT; (*missing modules array*)
UDIDMismatches : ARRAY[0..15]OF USINT; (*udid mismatch array*)
DifferentFirmware : ARRAY[0..15]OF USINT; (*different firmware array*)
END_STRUCT;
RemoteControlStatusTypeV2 : STRUCT (*remote control status from SafeLOGIC*)
Command : UINT; (*last received command*)
Number : UINT; (*running number of last received command*)
Status : UINT; (*status of command*)
State : UINT; (*state of the last ENTER command*)
EnterData : UINT; (*last received ENTER command that was correct executed*)
EnterNumber : UINT; (*running number of the last received ENTER command*)
EnterExecuteStatus : UINT; (*state of the last received ENTER command*)
SafeOSState : USINT; (*status of the safety application*)
SafeKEYChanged : USINT; (*SafeKEY has been exchanged*)
LedTestActive : USINT; (*LED test active*)
Scanning : USINT; (*module scan active*)
openSAFETYstate : USINT; (*status of openSAFETY stack*)
FailSafe : USINT; (*Fail-Safe status*)
NumberOfMissingModules : UINT; (*number of missing modules*)
NumberOfUDIDMismatches : UINT; (*number of mismatched modules*)
NumberOfDifferentFirmware : UINT; (*number of modules with different firmware*)
SADR : ARRAY[0..299]OF UINT; (*safety address array*)
MissingModules : ARRAY[0..39]OF USINT; (*missing modules array*)
UDIDMismatches : ARRAY[0..39]OF USINT; (*udid mismatch array*)
DifferentFirmware : ARRAY[0..39]OF USINT; (*different firmware array*)
NumberOfConfiguredModules : UINT; (*number of configured modules*)
SetupModeActive : USINT; (*setup mode active*)
ProjectPresent : USINT; (*project present*)
PasswordSet : USINT; (*password set*)
IsSL81xx : USINT; (*SCM is part of SL81xx*)
IsSCMar : USINT; (*SCM is part of SCMar*)
SetupModeSupported : USINT; (*setup mode is supported*)
END_STRUCT;
TableHeaderATypeV1 : STRUCT (*header struct for table type A version 1*)
xTol : DINT;
yTol : DINT;
END_STRUCT;
TableEntryATypeV1 : STRUCT (*entry struct for table type A version 1*)
xVal : DINT;
yVal : DINT;
resVal : USINT;
END_STRUCT;
TableEntryBTypeV1 : STRUCT (*entry struct for table type B version 1*)
xVal : DINT;
yVal : DINT;
zVal : DINT;
resVal : DINT;
END_STRUCT;
TableEntryCTypeV1 : STRUCT (*entry struct for table type C version 1*)
Zone : UINT;
Position : UINT;
Dimension : UINT;
END_STRUCT;
TableHeaderDTypeV1 : STRUCT (*header struct for table type A version 1*)
Surveillance : BYTE;
END_STRUCT;
TableEntryDTypeV1 : STRUCT (*entry struct for table type D version 1*)
Object : UINT;
Type : UINT;
MinimumBeam : UINT;
MaximumBeam : UINT;
Dimension : UINT;
DimensionTolerance : UINT;
END_STRUCT;
TableHeaderETypeV1 : STRUCT (*header struct for table type E version 1*)
xDim : INT;
yDim : INT;
END_STRUCT;
TableEntryETypeV1 : STRUCT (*entry struct for table type D version 1*)
Entry : DINT;
END_STRUCT;
TableEntrySTypeV1 : STRUCT (*entry struct for table type S version 1*)
LinkTargetObjectID : DINT;
LinkTargetAxisType : DINT;
LinkSourceObjectID : DINT;
LinkSourceAxisType : DINT;
LinkFactorNum : DINT;
LinkFactorDenom : DINT;
END_STRUCT;
TableHeaderTTypeV1 : STRUCT (*header struct for table type T version 1*)
NumberOfActiveAxes : DINT; (*number of active axes*)
END_STRUCT;
TableEntryTTypeV1 : STRUCT (*entry struct for table type T version 1*)
KinObjID : DINT;
KinObjType : DINT;
KinObjTransX : DINT;
KinObjTransY : DINT;
KinObjTransZ : DINT;
KinObjRotAngle1 : DINT;
KinObjRotAngle2 : DINT;
KinObjRotAngle3 : DINT;
KinObjRotaryAxisDecRamp : DINT;
KinObjRotaryAxisMaxAcc : DINT;
KinObjLinearAxisDecRamp : DINT;
KinObjLinearAxisMaxAcc : DINT;
END_STRUCT;
TableHeaderTTypeV2 : STRUCT (*header struct for table type T version 2*)
NumberOfTableObjects : UINT;
VersionNumber : UINT;
NumberOfActiveAxes : DINT;
END_STRUCT;
TableEntryTTypeV2 : STRUCT (*entry struct for table type T version 2*)
KinObjID : DINT;
KinObjType : DINT;
KinObjTransX : DINT;
KinObjTransY : DINT;
KinObjTransZ : DINT;
KinObjRotAngle1 : DINT;
KinObjRotAngle2 : DINT;
KinObjRotAngle3 : DINT;
KinObjRotaryAxisDecRamp : DINT;
KinObjRotaryAxisMaxAcc : DINT;
KinObjLinearAxisDecRamp : DINT;
KinObjLinearAxisMaxAcc : DINT;
KinObjActivateWireFrameModel : DINT;
KinObjDistanceToBndElements : DINT;
END_STRUCT;
TableHeaderTTypeV3 : STRUCT (*header struct for table type T version 3*)
NumberOfTableObjects : UINT;
VersionNumber : UINT;
NumberOfActiveAxes : DINT;
END_STRUCT;
TableEntryTTypeV3 : STRUCT (*entry struct for table type T version 3*)
KinObjID : DINT;
KinObjType : DINT;
KinObjTransX : DINT;
KinObjTransY : DINT;
KinObjTransZ : DINT;
KinObjRotAngle1 : DINT;
KinObjRotAngle2 : DINT;
KinObjRotAngle3 : DINT;
KinObjRotaryAxisDecRamp : DINT;
KinObjRotaryAxisMaxAcc : DINT;
KinObjLinearAxisDecRamp : DINT;
KinObjLinearAxisMaxAcc : DINT;
KinObjActivateWireFrameModel : DINT;
KinObjDistanceToBndElements : DINT;
END_STRUCT;
TableEntryUTypeV1 : STRUCT (*entry struct for table type U version 1*)
SpaceID : DINT;
SpaceType : DINT;
SpaceTransX : DINT;
SpaceTransY : DINT;
SpaceTransZ : DINT;
SpaceRotAngle1 : DINT;
SpaceRotAngle2 : DINT;
SpaceRotAngle3 : DINT;
SpaceDimensionX : DINT;
SpaceDimensionY : DINT;
SpaceDimensionZ : DINT;
END_STRUCT;
TableEntryVTypeV1 : STRUCT (*entry struct for table type V version 1*)
SpaceID : DINT;
SpaceType : DINT;
KinObjID : DINT;
KinObjJointAxisType : DINT;
SpaceMaxLimit : DINT;
SpaceMinLimit : DINT;
END_STRUCT;
TableEntryWTypeV1 : STRUCT (* entry struct for table type W version 1*)
OrientID : DINT;
OrientType : DINT;
OrientTransX_RotAngle1 : DINT;
OrientTransY_RotAngle2 : DINT;
OrientTransZ_RotAngle3 : DINT;
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,97 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsSafety
* File: AsSafety.var
* Author: B&R
* Created: May 25, 2012
********************************************************************
* Constants of library AsSafety
********************************************************************)
VAR CONSTANT
safeVERSION_R107 : UINT := 16#107; (*safety release version - 1.7*)
safeVERSION_R110 : UINT := 16#110; (*safety release version - 1.10*)
safeDATA_TYPE_MAOP : UINT := 16#100; (*download type for machine options *)
safeDATA_TYPE_EXTMAOP : UINT := 16#200; (*download type for extended machine options *)
safeDATA_TYPE_TABLE : UINT := 16#300; (*download type for table objects *)
safeDATA_TYPE_ADDPARA : UINT := 16#400; (*download type for additional parameter*)
safeDATA_TYPE_APPLICATION : UINT := 16#1200; (*type for restore*)
safeINFO_TYPE_PWD_INFO : UINT := 1; (*SL info type for password info*)
safeINFO_TYPE_PWD_CHK : UINT := 2; (*SL info type for password check*)
safeTABLE_FILE_TYPE : UINT := 16#0000; (*reference to table file*)
safeTABLE_DATA_TYPE : UINT := 16#0001; (*pointer to table data*)
safeSRC_TYPE_UPLOAD_FILE : UINT := 0; (*file upload from SafeLOGIC*)
safeSRC_TYPE_LOCAL_DATA : UINT := 1; (*local data from memory buffer*)
safeSRC_TYPE_LOCAL_FILE : UINT := 2; (*local data from file*)
safeCMD_ENTER : UINT := 16#100; (*enter command*)
safeCMD_STATUS : UINT := 16#200; (*status command*)
safeCMD_STATUS_SL : UINT := 16#0000; (*read back status*)
safeCMD_N_UDID_ACKN : UINT := 16#20; (*acknowledge N modules*)
safeCMD_4_UDID_ACKN : UINT := 16#30; (*acknowledge 4 modules*)
safeCMD_3_UDID_ACKN : UINT := 16#40; (*acknowledge 3 modules*)
safeCMD_2_UDID_ACKN : UINT := 16#50; (*acknowledge 2 modules*)
safeCMD_1_UDID_ACKN : UINT := 16#60; (*acknowledge 1 module*)
safeCMD_FW_ACKN : UINT := 16#100; (*acknowledge firmware*)
safeCMD_SK_XCHG : UINT := 16#200; (*acknowledge SafeKEY*)
safeCMD_TEST : UINT := 16#1000; (*LED test*)
safeCMD_SCAN : UINT := 16#2000; (*scan*)
safeCMD_SK_PW : UINT := 16#5000; (*change password*)
safeCMD_SK_FORMAT : UINT := 16#6000; (*format SafeKEY*)
safeCMD_RESET : UINT := 16#7000; (*reset SafeLOGIC*)
safeCMD_CLEAR_DATA : UINT := 16#8000; (*clear additonal downloaded data*)
safeCMD_SETUP_MODE_ACT : UINT := 16#9000; (*activate setup mode*)
safeCMD_SETUP_MODE_DEACT : UINT := 16#9100; (*deactivate setup mode*)
safeCMD_VERSION_INFO : UINT := 16#F000; (*remote version info*)
safeRET_NO_TIMESTAMP : UDINT := 16#FFFFFFFF; (*no timestamp available*)
safeERR_VERSION : UINT := 36100; (*error wrong version for command structure*)
safeERR_PW_LENGTH : UINT := 36101; (*error wrong password length*)
safeERR_UDID : UINT := 36102; (*error no UDID*)
safeERR_ALLOC_MEM : UINT := 36103; (*error allocating memory*)
safeERR_INTERNAL_ERROR : UINT := 36104; (*internal error*)
safeERR_TIMEOUT : UINT := 36105; (*error connection timeout*)
safeERR_RC_CMD : UINT := 36106; (*error wrong command*)
safeERR_RC_ENTER_DATA : UINT := 36107; (*error wrong data for ENTER command*)
safeERR_RC_ENTER_PW : UINT := 36108; (*error no password for command*)
safeERR_RC_ENTER_SK_PW : UINT := 36109; (*error no new password for command*)
safeERR_RC_STATUS_DATA : UINT := 36110; (*error wrong data for STATUS command*)
safeERR_RC_DATA_LENGTH : UINT := 36111; (*error worng length for status data*)
safeERR_DL_NO_PASSWORD : UINT := 36112; (*error no password for download*)
safeERR_DL_PROTOCOL : UINT := 36113; (*error protocol version for download*)
safeERR_DL_FILE_OPEN : UINT := 36114; (*error file open*)
safeERR_DL_FILE_INVALID : UINT := 36115; (*error file invalid*)
safeERR_DL_FILE_TOO_BIG : UINT := 36116; (*error file too big*)
safeERR_DL_WRITE : UINT := 36117; (*error write*)
safeERR_DL_STREAM : UINT := 36118; (*error stream*)
safeERR_DL_CHECKSUM : UINT := 36119; (*error checksum*)
safeERR_DL_UDID : UINT := 36120; (*error UDID doesn't match*)
safeERR_DL_WRONG_FILE_SIZE : UINT := 36121; (*error wrong file size*)
safeERR_DL_NO_RIGHTS_TO_WRITE : UINT := 36122; (*error wrong password*)
safeERR_DL_UNLOCK_FILE_INFO : UINT := 36123; (*error file info*)
safeERR_DL_UNLOCK_READ : UINT := 36124; (*error unlock read*)
safeERR_DL_UNLOCK_WRITE : UINT := 36125; (*error unlock write*)
safeERR_DL_STATIC_UNLOCK : UINT := 36126; (*error static unlock*)
safeERR_DL_COMPARE_FAILED : UINT := 36127; (*error data compare failed*)
safeERR_DLDATA_TYPE_ERR : UINT := 36128; (*error data type for download*)
safeERR_DLDATA_ERR_DATA : UINT := 36129; (*error data for download*)
safeERR_COT_TYPE_ERR : UINT := 36130; (*error data type for upload*)
safeERR_COT_READING_FILE : UINT := 36131; (*error reading file*)
safeERR_BUFFER_NULL : UINT := 36132; (*required input buffer is NULL*)
safeERR_BUFFER_TOO_SMALL : UINT := 36133; (*required input buffer is too small*)
safeERR_FILE_EMPTY : UINT := 36134; (*file is empty or does not exist on SL/SLX*)
safeERR_FI_TYPE_ERR : UINT := 36135; (*error data type for getting file info*)
safeERR_SLINFO_TYPE_ERR : UINT := 36136; (*error data type for SL info*)
safeERR_SLINFO_RET_ERR : UINT := 36137; (*remote command returns error*)
safeERR_COT_PWD_ERR : UINT := 36138; (*wrong password for configuration on target command*)
safeERR_TC_INV_TABTYPE : UINT := 36180; (*invalid table type*)
safeERR_TC_INV_INST : UINT := 36181; (*invalid table instance*)
safeERR_TC_INV_INPUT_PTR : UINT := 36182; (*invalid input pointer*)
safeERR_TC_INV_TAB_LEN : UINT := 36183; (*invalid table length*)
safeERR_TC_INV_USER : UINT := 36184; (*invalid user name*)
safeERR_TC_TYPE_CPY_FCT : UINT := 36185; (*no copy function for table type*)
safeWRN_TC_WAIT_FOR_ACK : UINT := 36191; (*wait for acknowledge of tables*)
safeERR_TC_CHECK_FAILED : UINT := 36186; (*table check failed*)
safeERR_TC_EXTRACT_FAILED : UINT := 36187; (*extraction of output table data failed*)
safeERR_TC_LOCK_FAILED : UINT := 36188; (*table lock failed*)
safeERR_TC_ACK_SET : UINT := 36189; (*AckData is already set*)
safeERR_TC_INVALID_STEP : UINT := 36190; (*invalid step in table check*)
END_VAR

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The AsSafety library provides function blocks for the safety system." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsSafety.fun</File>
<File>AsSafety.typ</File>
<File>AsSafety.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="standard" />
<Dependency ObjectName="FileIO" />
<Dependency ObjectName="astime" />
<Dependency ObjectName="DataObj" />
<Dependency ObjectName="AsXml" />
</Dependencies>
</Library>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,273 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsXml
* File: AsXml.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library AsXml
********************************************************************)
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlCreateMemoryReader (*creates an xml memory reader*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pXmlMemory : UDINT; (*pointer to the XML data*)
memorySize : UDINT; (*size of the XML data*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlCloseMemoryReader (*closes the xml memory reader*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlReadNextNode (*reads the next XML node*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
forceRead : BOOL; (*reads next Node even if last node could not be read successfully*)
skipSubtree : BOOL; (*avoids XML nodes in the subtree*)
pName : UDINT; (*pointer to buffer for the XML node name*)
nameSize : UDINT; (*size of the buffer for the XML node name*)
pValue : UDINT; (*pointer to buffer for the XML node value*)
valueSize : UDINT; (*size of the buffer for the XML node value*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
nodeType : UDINT; (*type of the XML node*)
depth : UDINT; (*depth of the XML node*)
isEmpty : BOOL; (*empty XML node?*)
attributeCount : UDINT; (*number of attributes*)
neededNameSize : UDINT; (*needed name buffer size*)
neededValueSize : UDINT; (*needed value buffer size*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlReadAttributeNr (*reads the next attribute of the XML node*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
index : UDINT; (*index of the attribute to read*)
pName : UDINT; (*pointer to buffer for the attribute name*)
nameSize : UDINT; (*size of the buffer for the XML attribute name*)
pValue : UDINT; (*pointer to buffer for the attribute value*)
valueSize : UDINT; (*size of the buffer for the XML attribute value*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
neededNameSize : UDINT; (*needed name buffer size*)
neededValueSize : UDINT; (*needed value buffer size*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlCreateMemoryWriter (*creates an xml memory writer*)
VAR_INPUT
enable : BOOL; (*enables execution*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlGetMemoryInfo (*gets the pointer to and the size of the created XML data*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
pXmlData : UDINT; (*pointer to the created XML data*)
xmlDataSize : UDINT; (*size of the created XML data*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlCloseMemoryWriter (*closes the xml memory writer and releases the allocated memory*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteStartDocument (*writes the version and the encoding of the document*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pVersion : UDINT; (*pointer to the version*)
pEncoding : UDINT; (*pointer to the encoding*)
pStandalone : UDINT; (*pointer to the standalone text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteStartDocEnc (*writes the version and the encoding of the document and sets the input encoding*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pVersion : UDINT; (*pointer to the version*)
pInputEncoding : UDINT; (*pointer to the input encoding e.g. "ISO-8859-1"*)
pOutputEncoding : UDINT; (*pointer to the output encoding e.g. "UTF-8"*)
pStandalone : UDINT; (*pointer to the standalone text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteEndDocument (*finishes the document*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteStartElement (*starts a new XML element*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pName : UDINT; (*pointer to the XML element name*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteAttribute (*adds an attribute to the current XML element*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pName : UDINT; (*pointer to the XML attribute name*)
pValue : UDINT; (*pointer to the XML attribute value*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteElementText (*writes an XML element text*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pText : UDINT; (*pointer to the element text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteElementTextEx (*writes an XML element text*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pText : UDINT; (*pointer to the element text*)
textLen : UDINT; (*length of the element text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteEndElement (*closes the current XML element*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteComment (*writes an XML comment*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pText : UDINT; (*pointer to the comment text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteCommentEx (*writes an XML comment*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pText : UDINT; (*pointer to the comment text*)
textLen : UDINT; (*length of the comment text*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteCData (*writes an XML CDATA Section*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pCData : UDINT; (*pointer to the CDATA data*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWriteCDataEx (*writes an XML CDATA Section*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pCData : UDINT; (*pointer to the CDATA*)
cdataLen : UDINT; (*length of the CDATA*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK xmlWritePI (*writes an XML process instruction*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier*)
pTarget : UDINT; (*pointer to the process instruction*)
pValue : UDINT; (*pointer to the pi value*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK

View File

@@ -0,0 +1,13 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsXml
* File: AsXml.typ
* Author: B+R
********************************************************************
* Data types of library AsXml
********************************************************************)
TYPE
END_TYPE

View File

@@ -0,0 +1,37 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsXml
* File: AsXml.var
* Author: B+R
********************************************************************
* Local variables of library AsXml
********************************************************************)
VAR CONSTANT
xmlERR_MEMORY : UINT := 33810; (*memory error*)
xmlERR_INVALID_PARAMETER : UINT := 33811; (*wrong parameter or nullpointer given*)
xmlERR_GENERAL : UINT := 33812; (*general XML error*)
xmlERR_NO_FURTHER_XML_NODE : UINT := 33813; (*no further XML node available*)
xmlERR_NAME_BUFFER_TOO_SMALL: UINT := 33814; (*buffer for name too small*)
xmlERR_VALUE_BUFFER_TOO_SMALL: UINT := 33815; (*buffer for value too small*)
xmlERR_INVALID_ATTRIBUTE_INDEX: UINT := 33816; (*invalid attribute index*)
xmlERR_NO_ATTRIBUTES : UINT := 33817; (*no attribute available*)
xmlERR_XML_DATA_INVALID : UINT := 33818; (*xml data is invalid*)
xmlERR_INVALID_IDENT : UINT := 33819; (*error identifier invalid*)
xmlERR_NO_ELEMENT_OPEN : UINT := 33820; (*no open XML element where to put the attribute*)
xmlERR_INVALID_POSITION : UINT := 33821; (*invalid position for this node*)
xmlERR_CONVERT : UINT := 33822; (*error during converting text*)
xmlERR_CONVERT_TEXT : UINT := 33823; (*error converting text*)
xmlERR_UNSUPPORTED_ENCODING : UINT := 33824; (*unsupported encoding*)
xmlNODE_TYPE_ELEMENT : UINT := 1; (*XML element node*)
xmlNODE_TYPE_TEXT : UINT := 3; (*XML element text*)
xmlNODE_TYPE_CDATA : UINT := 4; (*XML CDATA section*)
xmlNODE_TYPE_PI : UINT := 7; (*XML process instruction node*)
xmlNODE_TYPE_COMMENT : UINT := 8; (*XML comment*)
xmlNODE_TYPE_WHITESPACE : UINT := 13; (*XML white space*)
xmlNODE_TYPE_SIGN_WHITESPACE: UINT := 14; (*XML significant white space*)
xmlNODE_TYPE_ENDELEMENT : UINT := 15; (*XML end element node*)
END_VAR

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The AsXml library supports reading and writing of XML files." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsXml.fun</File>
<File>AsXml.typ</File>
<File>AsXml.var</File>
</Files>
</Library>

View File

@@ -0,0 +1,347 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASXML_
#define _ASXML_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define xmlNODE_TYPE_ENDELEMENT 15U
#define xmlNODE_TYPE_SIGN_WHITESPACE 14U
#define xmlNODE_TYPE_WHITESPACE 13U
#define xmlNODE_TYPE_COMMENT 8U
#define xmlNODE_TYPE_PI 7U
#define xmlNODE_TYPE_CDATA 4U
#define xmlNODE_TYPE_TEXT 3U
#define xmlNODE_TYPE_ELEMENT 1U
#define xmlERR_UNSUPPORTED_ENCODING 33824U
#define xmlERR_CONVERT_TEXT 33823U
#define xmlERR_CONVERT 33822U
#define xmlERR_INVALID_POSITION 33821U
#define xmlERR_NO_ELEMENT_OPEN 33820U
#define xmlERR_INVALID_IDENT 33819U
#define xmlERR_XML_DATA_INVALID 33818U
#define xmlERR_NO_ATTRIBUTES 33817U
#define xmlERR_INVALID_ATTRIBUTE_INDEX 33816U
#define xmlERR_VALUE_BUFFER_TOO_SMALL 33815U
#define xmlERR_NAME_BUFFER_TOO_SMALL 33814U
#define xmlERR_NO_FURTHER_XML_NODE 33813U
#define xmlERR_GENERAL 33812U
#define xmlERR_INVALID_PARAMETER 33811U
#define xmlERR_MEMORY 33810U
#else
#ifndef _GLOBAL_CONST
#define _GLOBAL_CONST _WEAK const
#endif
_GLOBAL_CONST unsigned short xmlNODE_TYPE_ENDELEMENT;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_SIGN_WHITESPACE;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_WHITESPACE;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_COMMENT;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_PI;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_CDATA;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_TEXT;
_GLOBAL_CONST unsigned short xmlNODE_TYPE_ELEMENT;
_GLOBAL_CONST unsigned short xmlERR_UNSUPPORTED_ENCODING;
_GLOBAL_CONST unsigned short xmlERR_CONVERT_TEXT;
_GLOBAL_CONST unsigned short xmlERR_CONVERT;
_GLOBAL_CONST unsigned short xmlERR_INVALID_POSITION;
_GLOBAL_CONST unsigned short xmlERR_NO_ELEMENT_OPEN;
_GLOBAL_CONST unsigned short xmlERR_INVALID_IDENT;
_GLOBAL_CONST unsigned short xmlERR_XML_DATA_INVALID;
_GLOBAL_CONST unsigned short xmlERR_NO_ATTRIBUTES;
_GLOBAL_CONST unsigned short xmlERR_INVALID_ATTRIBUTE_INDEX;
_GLOBAL_CONST unsigned short xmlERR_VALUE_BUFFER_TOO_SMALL;
_GLOBAL_CONST unsigned short xmlERR_NAME_BUFFER_TOO_SMALL;
_GLOBAL_CONST unsigned short xmlERR_NO_FURTHER_XML_NODE;
_GLOBAL_CONST unsigned short xmlERR_GENERAL;
_GLOBAL_CONST unsigned short xmlERR_INVALID_PARAMETER;
_GLOBAL_CONST unsigned short xmlERR_MEMORY;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct xmlCreateMemoryReader
{
/* VAR_INPUT (analog) */
unsigned long pXmlMemory;
unsigned long memorySize;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlCreateMemoryReader_typ;
typedef struct xmlCloseMemoryReader
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlCloseMemoryReader_typ;
typedef struct xmlReadNextNode
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pName;
unsigned long nameSize;
unsigned long pValue;
unsigned long valueSize;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long nodeType;
unsigned long depth;
unsigned long attributeCount;
unsigned long neededNameSize;
unsigned long neededValueSize;
/* VAR_INPUT (digital) */
plcbit enable;
plcbit forceRead;
plcbit skipSubtree;
/* VAR_OUTPUT (digital) */
plcbit isEmpty;
} xmlReadNextNode_typ;
typedef struct xmlReadAttributeNr
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long index;
unsigned long pName;
unsigned long nameSize;
unsigned long pValue;
unsigned long valueSize;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long neededNameSize;
unsigned long neededValueSize;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlReadAttributeNr_typ;
typedef struct xmlCreateMemoryWriter
{
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlCreateMemoryWriter_typ;
typedef struct xmlGetMemoryInfo
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long pXmlData;
unsigned long xmlDataSize;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlGetMemoryInfo_typ;
typedef struct xmlCloseMemoryWriter
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlCloseMemoryWriter_typ;
typedef struct xmlWriteStartDocument
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pVersion;
unsigned long pEncoding;
unsigned long pStandalone;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteStartDocument_typ;
typedef struct xmlWriteStartDocEnc
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pVersion;
unsigned long pInputEncoding;
unsigned long pOutputEncoding;
unsigned long pStandalone;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteStartDocEnc_typ;
typedef struct xmlWriteEndDocument
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteEndDocument_typ;
typedef struct xmlWriteStartElement
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pName;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteStartElement_typ;
typedef struct xmlWriteAttribute
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pName;
unsigned long pValue;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteAttribute_typ;
typedef struct xmlWriteElementText
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pText;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteElementText_typ;
typedef struct xmlWriteElementTextEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pText;
unsigned long textLen;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteElementTextEx_typ;
typedef struct xmlWriteEndElement
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteEndElement_typ;
typedef struct xmlWriteComment
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pText;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteComment_typ;
typedef struct xmlWriteCommentEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pText;
unsigned long textLen;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteCommentEx_typ;
typedef struct xmlWriteCData
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pCData;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteCData_typ;
typedef struct xmlWriteCDataEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pCData;
unsigned long cdataLen;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWriteCDataEx_typ;
typedef struct xmlWritePI
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pTarget;
unsigned long pValue;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} xmlWritePI_typ;
/* Prototyping of functions and function blocks */
_BUR_PUBLIC void xmlCreateMemoryReader(struct xmlCreateMemoryReader* inst);
_BUR_PUBLIC void xmlCloseMemoryReader(struct xmlCloseMemoryReader* inst);
_BUR_PUBLIC void xmlReadNextNode(struct xmlReadNextNode* inst);
_BUR_PUBLIC void xmlReadAttributeNr(struct xmlReadAttributeNr* inst);
_BUR_PUBLIC void xmlCreateMemoryWriter(struct xmlCreateMemoryWriter* inst);
_BUR_PUBLIC void xmlGetMemoryInfo(struct xmlGetMemoryInfo* inst);
_BUR_PUBLIC void xmlCloseMemoryWriter(struct xmlCloseMemoryWriter* inst);
_BUR_PUBLIC void xmlWriteStartDocument(struct xmlWriteStartDocument* inst);
_BUR_PUBLIC void xmlWriteStartDocEnc(struct xmlWriteStartDocEnc* inst);
_BUR_PUBLIC void xmlWriteEndDocument(struct xmlWriteEndDocument* inst);
_BUR_PUBLIC void xmlWriteStartElement(struct xmlWriteStartElement* inst);
_BUR_PUBLIC void xmlWriteAttribute(struct xmlWriteAttribute* inst);
_BUR_PUBLIC void xmlWriteElementText(struct xmlWriteElementText* inst);
_BUR_PUBLIC void xmlWriteElementTextEx(struct xmlWriteElementTextEx* inst);
_BUR_PUBLIC void xmlWriteEndElement(struct xmlWriteEndElement* inst);
_BUR_PUBLIC void xmlWriteComment(struct xmlWriteComment* inst);
_BUR_PUBLIC void xmlWriteCommentEx(struct xmlWriteCommentEx* inst);
_BUR_PUBLIC void xmlWriteCData(struct xmlWriteCData* inst);
_BUR_PUBLIC void xmlWriteCDataEx(struct xmlWriteCDataEx* inst);
_BUR_PUBLIC void xmlWritePI(struct xmlWritePI* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASXML_ */

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The DataObj library can be used to dynamically create, dynamically delete and copy data objects, etc. " xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>DataObj.fun</File>
<File>DataObj.typ</File>
<File>DataObj.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,166 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: DataObj
* File: DataObj.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library DataObj
********************************************************************)
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCreate (*creates a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
grp :USINT; (*group ID for the data object (default 0x00), must be set to zero*)
pName :UDINT; (*pointer to name of the data object to be created*)
len :UDINT; (*length of the data area of the data object to be created*)
MemType :USINT; (*type of target memory: doTEMP, doUSRRAM, doUSRROM, doSYSROM, doFIXRAM, doMEMCARD*)
Option :UDINT; (*options: doNO_CS*)
pCpyData :UDINT; (*pointer to data written to the data object during generation*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
ident :UDINT; (*ID of the created data object*)
pDatObjMem :UDINT; (*pointer to the data in the data object*)
END_VAR
VAR
i_state :UDINT; (*internal variable*)
i_result :UDINT; (*internal variable*)
i_spare :ARRAY[0..104] OF USINT; (*internal variable*)
i_spare_1 :UDINT; (*internal variable*)
i_spare_2 :UINT; (*internal variable*)
i_spare_3 :UDINT; (*internal variable*)
i_spare_4 :USINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjWrite (*writes to a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
Offset :UDINT; (*offset in the data area of the data object*)
pSource :UDINT; (*pointer to the data copied to the data object*)
len :UDINT; (*length of the data to be copied*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjRead (*reads from a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
Offset :UDINT; (*offset in the data area of the data object*)
pDestination:UDINT; (*memory to which the data to be read is copied*)
len :UDINT; (*length of the data to be copied*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDelete (*deletes data objects*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
VAR
i_state :UDINT; (*internal variable*)
i_result :UDINT; (*internal variable*)
i_spare :USINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjMove (*moves the storage space of a data object to a new target memory*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
MemType :USINT; (*target memory in which the data object is to be saved, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
Option :UDINT; (*options for the object to be saved (doNO_CS = no checksum)*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
identNew :UDINT; (*ID of the new data object*)
pDatObjMem :UDINT; (*pointer to the data in the newly created data object*)
END_VAR
VAR
i_state :UDINT; (*internal variable*)
i_result :UDINT; (*internal variable*)
i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
i_spare_1 :UDINT; (*internal variable*)
i_spare_2 :USINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCopy (*copies a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object to be copied*)
pNameTarget :UDINT; (*pointer to name of the new data object*)
MemTypeTarget :USINT; (*target memory in which the new object is to be generated, e.g. doTEMP, doUSRRAM, ...*)
OptionTarget :UDINT; (*options for the copied object (doNO_CS = no checksum)*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
identNew :UDINT; (*ID of the copied data object*)
pDatObjMemNew :UDINT; (*pointer to the data in the newly created data object*)
END_VAR
VAR
i_state :UDINT; (*internal variable*)
i_result :UDINT; (*internal variable*)
i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
i_spare_1 :UDINT; (*internal variable*)
i_spare_2 :USINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjInfo (*gives information about a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
pName :UDINT; (*name of data object*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
ident :UDINT; (*ID of the data object*)
pDatObjMem :UDINT; (*pointer to the data in the data object*)
len :UDINT; (*length of the data area in the data object*)
MemType :USINT; (*memory type in which the data object is located, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
Option :UDINT; (*information about data object options*)
ChangeDate :DATE_AND_TIME; (*modification date of the data object*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjChangeDate (*changes the modification date of a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
pName :UDINT; (*pointer to name of data object*)
SetDate :DATE_AND_TIME; (*date and time; if the value 0 is transferred, the current PLC system time is used*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjAttach (*attaches a data object to prevent deletion*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDetach (*detaches a data object*)
VAR_INPUT
enable :BOOL; (*enables execution*)
ident :UDINT; (*ID of the data object*)
END_VAR
VAR_OUTPUT
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK

View File

@@ -0,0 +1,23 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: DataObj
* File: DataObj.typ
* Author: B+R
********************************************************************
* Data types of library DataObj
********************************************************************)
TYPE
END_TYPE

View File

@@ -0,0 +1,36 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: DataObj
* File: DataObj.var
* Author: B+R
********************************************************************
* Local variables of library DataObj
********************************************************************)
VAR CONSTANT
doERR_TOOLONG_MODULNAME : UINT := 20613; (*module name too long (max. 10 characters)*)
doERR_CHECKSUM_WARNING : UINT := 20630; (*wrong target memory specified for the "doNO_CS" option*)
doERR_MODULNOTFOUND : UINT := 20609; (*data object not found*)
doERR_ILLEGALLENGTH : UINT := 20608; (*wrong length specified*)
doERR_STARTHANDLER : UINT := 20612; (*error while enabling asynchronous handler (only SG4)*)
doERR_ILLPARAMETER : UINT := 20600; (*wrong parameter given (NULL pointer)*)
doERR_WRONGOFFSET : UINT := 20607; (*wrong offset specified*)
doERR_ILLOBJTYPE : UINT := 20606; (*wrong object type (not data object)*)
doERR_ILLMEMTYPE : UINT := 20602; (*wrong target memory specified*)
doERR_WRONGTIME : UINT := 20610; (*wrong date in SetDate (DatObjChangeDate)*)
doERR_ILLOBJECT : UINT := 20605; (*object not found*)
doERR_DUPOBJECT : UINT := 20601; (*object already present*)
doERR_BRINSTALL : UINT := 20604; (*error installing data object*)
doERR_NOMEMORY : UINT := 20603; (*no memory available for module to be created*)
doERR_ILLSTATE : UINT := 20611; (*incorrect state of the data object*)
doERR_BURNINGOBJECT : UINT := 20614; (*error while saving the data object in "Flash" memory*)
doERR_MODULDELETE_SYSROM : UINT := 20615; (*a module in SYSROM cannot be deleted*)
doSYSROM : USINT := 0; (*SYSROM (SYSTEM FLASH)*)
doNO_CS : USINT := 1; (*no cyclic checksum monitoring and no checksum monitoring during installation and booting*)
doUSRROM : USINT := 2; (*USERROM (USER FLASH)*)
doUSRRAM : USINT := 3; (*USERRAM (target memory for pointer handling)*)
doMEMCARD : USINT := 4; (*MEMCARD (only for SG3)*)
doFIXRAM : USINT := 5; (*FIXRAM (only for SG3)*)
doTEMP : USINT := 65; (*Temporary data object (DRAM, only for SG4)*)
END_VAR

View File

@@ -0,0 +1,225 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _DATAOBJ_
#define _DATAOBJ_
#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 doTEMP 65U
#define doFIXRAM 5U
#define doMEMCARD 4U
#define doUSRRAM 3U
#define doUSRROM 2U
#define doNO_CS 1U
#define doSYSROM 0U
#define doERR_BURNINGOBJECT 20614U
#define doERR_ILLSTATE 20611U
#define doERR_NOMEMORY 20603U
#define doERR_BRINSTALL 20604U
#define doERR_DUPOBJECT 20601U
#define doERR_ILLOBJECT 20605U
#define doERR_WRONGTIME 20610U
#define doERR_ILLMEMTYPE 20602U
#define doERR_ILLOBJTYPE 20606U
#define doERR_WRONGOFFSET 20607U
#define doERR_ILLPARAMETER 20600U
#define doERR_STARTHANDLER 20612U
#define doERR_ILLEGALLENGTH 20608U
#define doERR_MODULNOTFOUND 20609U
#define doERR_CHECKSUM_WARNING 20630U
#define doERR_TOOLONG_MODULNAME 20613U
#else
_IEC_CONST unsigned char doTEMP = 65U;
_IEC_CONST unsigned char doFIXRAM = 5U;
_IEC_CONST unsigned char doMEMCARD = 4U;
_IEC_CONST unsigned char doUSRRAM = 3U;
_IEC_CONST unsigned char doUSRROM = 2U;
_IEC_CONST unsigned char doNO_CS = 1U;
_IEC_CONST unsigned char doSYSROM = 0U;
_IEC_CONST unsigned short doERR_BURNINGOBJECT = 20614U;
_IEC_CONST unsigned short doERR_ILLSTATE = 20611U;
_IEC_CONST unsigned short doERR_NOMEMORY = 20603U;
_IEC_CONST unsigned short doERR_BRINSTALL = 20604U;
_IEC_CONST unsigned short doERR_DUPOBJECT = 20601U;
_IEC_CONST unsigned short doERR_ILLOBJECT = 20605U;
_IEC_CONST unsigned short doERR_WRONGTIME = 20610U;
_IEC_CONST unsigned short doERR_ILLMEMTYPE = 20602U;
_IEC_CONST unsigned short doERR_ILLOBJTYPE = 20606U;
_IEC_CONST unsigned short doERR_WRONGOFFSET = 20607U;
_IEC_CONST unsigned short doERR_ILLPARAMETER = 20600U;
_IEC_CONST unsigned short doERR_STARTHANDLER = 20612U;
_IEC_CONST unsigned short doERR_ILLEGALLENGTH = 20608U;
_IEC_CONST unsigned short doERR_MODULNOTFOUND = 20609U;
_IEC_CONST unsigned short doERR_CHECKSUM_WARNING = 20630U;
_IEC_CONST unsigned short doERR_TOOLONG_MODULNAME = 20613U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct DatObjCreate
{
/* VAR_INPUT (analog) */
unsigned char grp;
unsigned long pName;
unsigned long len;
unsigned char MemType;
unsigned long Option;
unsigned long pCpyData;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[105];
unsigned long i_spare_1;
unsigned short i_spare_2;
unsigned long i_spare_3;
unsigned char i_spare_4;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCreate_typ;
typedef struct DatObjWrite
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pSource;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjWrite_typ;
typedef struct DatObjRead
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pDestination;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjRead_typ;
typedef struct DatObjDelete
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjDelete_typ;
typedef struct DatObjMove
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned char MemType;
unsigned long Option;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjMove_typ;
typedef struct DatObjCopy
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pNameTarget;
unsigned char MemTypeTarget;
unsigned long OptionTarget;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMemNew;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCopy_typ;
typedef struct DatObjInfo
{
/* VAR_INPUT (analog) */
unsigned long pName;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
unsigned long len;
unsigned char MemType;
unsigned long Option;
plcdt ChangeDate;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjInfo_typ;
typedef struct DatObjChangeDate
{
/* VAR_INPUT (analog) */
unsigned long pName;
plcdt SetDate;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjChangeDate_typ;
/* Prototyping of functions and function blocks */
void DatObjCreate(struct DatObjCreate* inst);
void DatObjWrite(struct DatObjWrite* inst);
void DatObjRead(struct DatObjRead* inst);
void DatObjDelete(struct DatObjDelete* inst);
void DatObjMove(struct DatObjMove* inst);
void DatObjCopy(struct DatObjCopy* inst);
void DatObjInfo(struct DatObjInfo* inst);
void DatObjChangeDate(struct DatObjChangeDate* inst);
#ifdef __cplusplus
};
#endif
#endif /* _DATAOBJ_ */

View File

@@ -0,0 +1,250 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _DATAOBJ_
#define _DATAOBJ_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define doTEMP 65U
#define doFIXRAM 5U
#define doMEMCARD 4U
#define doUSRRAM 3U
#define doUSRROM 2U
#define doNO_CS 1U
#define doSYSROM 0U
#define doERR_MODULDELETE_SYSROM 20615U
#define doERR_BURNINGOBJECT 20614U
#define doERR_ILLSTATE 20611U
#define doERR_NOMEMORY 20603U
#define doERR_BRINSTALL 20604U
#define doERR_DUPOBJECT 20601U
#define doERR_ILLOBJECT 20605U
#define doERR_WRONGTIME 20610U
#define doERR_ILLMEMTYPE 20602U
#define doERR_ILLOBJTYPE 20606U
#define doERR_WRONGOFFSET 20607U
#define doERR_ILLPARAMETER 20600U
#define doERR_STARTHANDLER 20612U
#define doERR_ILLEGALLENGTH 20608U
#define doERR_MODULNOTFOUND 20609U
#define doERR_CHECKSUM_WARNING 20630U
#define doERR_TOOLONG_MODULNAME 20613U
#else
#ifndef _GLOBAL_CONST
#define _GLOBAL_CONST _WEAK const
#endif
_GLOBAL_CONST unsigned char doTEMP;
_GLOBAL_CONST unsigned char doFIXRAM;
_GLOBAL_CONST unsigned char doMEMCARD;
_GLOBAL_CONST unsigned char doUSRRAM;
_GLOBAL_CONST unsigned char doUSRROM;
_GLOBAL_CONST unsigned char doNO_CS;
_GLOBAL_CONST unsigned char doSYSROM;
_GLOBAL_CONST unsigned short doERR_MODULDELETE_SYSROM;
_GLOBAL_CONST unsigned short doERR_BURNINGOBJECT;
_GLOBAL_CONST unsigned short doERR_ILLSTATE;
_GLOBAL_CONST unsigned short doERR_NOMEMORY;
_GLOBAL_CONST unsigned short doERR_BRINSTALL;
_GLOBAL_CONST unsigned short doERR_DUPOBJECT;
_GLOBAL_CONST unsigned short doERR_ILLOBJECT;
_GLOBAL_CONST unsigned short doERR_WRONGTIME;
_GLOBAL_CONST unsigned short doERR_ILLMEMTYPE;
_GLOBAL_CONST unsigned short doERR_ILLOBJTYPE;
_GLOBAL_CONST unsigned short doERR_WRONGOFFSET;
_GLOBAL_CONST unsigned short doERR_ILLPARAMETER;
_GLOBAL_CONST unsigned short doERR_STARTHANDLER;
_GLOBAL_CONST unsigned short doERR_ILLEGALLENGTH;
_GLOBAL_CONST unsigned short doERR_MODULNOTFOUND;
_GLOBAL_CONST unsigned short doERR_CHECKSUM_WARNING;
_GLOBAL_CONST unsigned short doERR_TOOLONG_MODULNAME;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct DatObjCreate
{
/* VAR_INPUT (analog) */
unsigned char grp;
unsigned long pName;
unsigned long len;
unsigned char MemType;
unsigned long Option;
unsigned long pCpyData;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[105];
unsigned long i_spare_1;
unsigned short i_spare_2;
unsigned long i_spare_3;
unsigned char i_spare_4;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCreate_typ;
typedef struct DatObjWrite
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pSource;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjWrite_typ;
typedef struct DatObjRead
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pDestination;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjRead_typ;
typedef struct DatObjDelete
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjDelete_typ;
typedef struct DatObjMove
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned char MemType;
unsigned long Option;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjMove_typ;
typedef struct DatObjCopy
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pNameTarget;
unsigned char MemTypeTarget;
unsigned long OptionTarget;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMemNew;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCopy_typ;
typedef struct DatObjInfo
{
/* VAR_INPUT (analog) */
unsigned long pName;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
unsigned long len;
unsigned char MemType;
unsigned long Option;
plcdt ChangeDate;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjInfo_typ;
typedef struct DatObjChangeDate
{
/* VAR_INPUT (analog) */
unsigned long pName;
plcdt SetDate;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjChangeDate_typ;
typedef struct DatObjAttach
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjAttach_typ;
typedef struct DatObjDetach
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjDetach_typ;
/* Prototyping of functions and function blocks */
_BUR_PUBLIC void DatObjCreate(struct DatObjCreate* inst);
_BUR_PUBLIC void DatObjWrite(struct DatObjWrite* inst);
_BUR_PUBLIC void DatObjRead(struct DatObjRead* inst);
_BUR_PUBLIC void DatObjDelete(struct DatObjDelete* inst);
_BUR_PUBLIC void DatObjMove(struct DatObjMove* inst);
_BUR_PUBLIC void DatObjCopy(struct DatObjCopy* inst);
_BUR_PUBLIC void DatObjInfo(struct DatObjInfo* inst);
_BUR_PUBLIC void DatObjChangeDate(struct DatObjChangeDate* inst);
_BUR_PUBLIC void DatObjAttach(struct DatObjAttach* inst);
_BUR_PUBLIC void DatObjDetach(struct DatObjDetach* inst);
#ifdef __cplusplus
};
#endif
#endif /* _DATAOBJ_ */

View File

@@ -0,0 +1,225 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _DATAOBJ_
#define _DATAOBJ_
#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 doTEMP 65U
#define doFIXRAM 5U
#define doMEMCARD 4U
#define doUSRRAM 3U
#define doUSRROM 2U
#define doNO_CS 1U
#define doSYSROM 0U
#define doERR_BURNINGOBJECT 20614U
#define doERR_ILLSTATE 20611U
#define doERR_NOMEMORY 20603U
#define doERR_BRINSTALL 20604U
#define doERR_DUPOBJECT 20601U
#define doERR_ILLOBJECT 20605U
#define doERR_WRONGTIME 20610U
#define doERR_ILLMEMTYPE 20602U
#define doERR_ILLOBJTYPE 20606U
#define doERR_WRONGOFFSET 20607U
#define doERR_ILLPARAMETER 20600U
#define doERR_STARTHANDLER 20612U
#define doERR_ILLEGALLENGTH 20608U
#define doERR_MODULNOTFOUND 20609U
#define doERR_CHECKSUM_WARNING 20630U
#define doERR_TOOLONG_MODULNAME 20613U
#else
_IEC_CONST unsigned char doTEMP = 65U;
_IEC_CONST unsigned char doFIXRAM = 5U;
_IEC_CONST unsigned char doMEMCARD = 4U;
_IEC_CONST unsigned char doUSRRAM = 3U;
_IEC_CONST unsigned char doUSRROM = 2U;
_IEC_CONST unsigned char doNO_CS = 1U;
_IEC_CONST unsigned char doSYSROM = 0U;
_IEC_CONST unsigned short doERR_BURNINGOBJECT = 20614U;
_IEC_CONST unsigned short doERR_ILLSTATE = 20611U;
_IEC_CONST unsigned short doERR_NOMEMORY = 20603U;
_IEC_CONST unsigned short doERR_BRINSTALL = 20604U;
_IEC_CONST unsigned short doERR_DUPOBJECT = 20601U;
_IEC_CONST unsigned short doERR_ILLOBJECT = 20605U;
_IEC_CONST unsigned short doERR_WRONGTIME = 20610U;
_IEC_CONST unsigned short doERR_ILLMEMTYPE = 20602U;
_IEC_CONST unsigned short doERR_ILLOBJTYPE = 20606U;
_IEC_CONST unsigned short doERR_WRONGOFFSET = 20607U;
_IEC_CONST unsigned short doERR_ILLPARAMETER = 20600U;
_IEC_CONST unsigned short doERR_STARTHANDLER = 20612U;
_IEC_CONST unsigned short doERR_ILLEGALLENGTH = 20608U;
_IEC_CONST unsigned short doERR_MODULNOTFOUND = 20609U;
_IEC_CONST unsigned short doERR_CHECKSUM_WARNING = 20630U;
_IEC_CONST unsigned short doERR_TOOLONG_MODULNAME = 20613U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct DatObjCreate
{
/* VAR_INPUT (analog) */
unsigned char grp;
unsigned long pName;
unsigned long len;
unsigned char MemType;
unsigned long Option;
unsigned long pCpyData;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[105];
unsigned long i_spare_1;
unsigned short i_spare_2;
unsigned long i_spare_3;
unsigned char i_spare_4;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCreate_typ;
typedef struct DatObjWrite
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pSource;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjWrite_typ;
typedef struct DatObjRead
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long Offset;
unsigned long pDestination;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjRead_typ;
typedef struct DatObjDelete
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjDelete_typ;
typedef struct DatObjMove
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned char MemType;
unsigned long Option;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMem;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjMove_typ;
typedef struct DatObjCopy
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pNameTarget;
unsigned char MemTypeTarget;
unsigned long OptionTarget;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long identNew;
unsigned long pDatObjMemNew;
/* VAR (analog) */
unsigned long i_state;
unsigned long i_result;
unsigned char i_spare[41];
unsigned long i_spare_1;
unsigned char i_spare_2;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjCopy_typ;
typedef struct DatObjInfo
{
/* VAR_INPUT (analog) */
unsigned long pName;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long pDatObjMem;
unsigned long len;
unsigned char MemType;
unsigned long Option;
plcdt ChangeDate;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjInfo_typ;
typedef struct DatObjChangeDate
{
/* VAR_INPUT (analog) */
unsigned long pName;
plcdt SetDate;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR_INPUT (digital) */
plcbit enable;
} DatObjChangeDate_typ;
/* Prototyping of functions and function blocks */
void DatObjCreate(struct DatObjCreate* inst);
void DatObjWrite(struct DatObjWrite* inst);
void DatObjRead(struct DatObjRead* inst);
void DatObjDelete(struct DatObjDelete* inst);
void DatObjMove(struct DatObjMove* inst);
void DatObjCopy(struct DatObjCopy* inst);
void DatObjInfo(struct DatObjInfo* inst);
void DatObjChangeDate(struct DatObjChangeDate* inst);
#ifdef __cplusplus
};
#endif
#endif /* _DATAOBJ_ */

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Description="The FileIO library provides function blocks for file handling." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>FileIO.fun</File>
<File>FileIO.typ</File>
<File>FileIO.var</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,570 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: FileIO
* File: FileIO.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library FileIO
********************************************************************)
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCreate (*creates a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pFile : UDINT; (*pointer to the file name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier of the created file*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileOpen (*opens a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pFile : UDINT; (*pointer to the file name*)
mode : USINT; (*access mode (FILE_R, FILE_W, FILE_RW)*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier of the created file*)
filelen : UDINT; (*file length*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileClose (*closes an open file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the created file*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRead (*reads from an open file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the created file*)
offset : UDINT; (*offset*)
pDest : UDINT; (*pointer to the read buffer*)
len : UDINT; (*length of bytes to read*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileReadEx (*reads from an open file and returns the number of actually read bytes; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the created file*)
offset : UDINT; (*offset*)
pDest : UDINT; (*pointer to the read buffer*)
len : UDINT; (*number of bytes to read*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
bytesread : UDINT; (*number of bytes read*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWrite (*writes to a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the created file*)
offset : UDINT; (*offset*)
pSrc : UDINT; (*pointer to the write buffer*)
len : UDINT; (*number of bytes to write*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWriteEx (*writes to a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the created file*)
offset : UDINT; (*offset*)
pSrc : UDINT; (*pointer to the write buffer*)
len : UDINT; (*number of bytes to write*)
option : UDINT; (*options*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRename (*renames files; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the file name*)
pNewName : UDINT; (*pointer to the new file name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCopy (*copies a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pSrcDev : UDINT; (*pointer to the source file device name*)
pSrc : UDINT; (*pointer to the existing file name*)
pDestDev : UDINT; (*pointer to the destination file device name*)
pDest : UDINT; (*pointer to the copy file name*)
option : USINT; (*copy option*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileDelete (*deletes a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the file name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileInfo (*gets information about a file; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*file name given as pointer*)
pInfo : UDINT; (*file information (fiFILE_INFO) structure given as pointer*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileTruncate (*truncates a file's length; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*file name given as pointer*)
newLength : UDINT; (*new length*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCreate (*creates a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the directory name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirOpen (*opens a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the directory name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier of the directory*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirClose (*closes a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the directory*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRead (*reads the individual file names in a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pPath : UDINT; (*pointer to the path string*)
entry : UDINT; (*specifies which entry should be read*)
option : USINT; (*specifies whether directory names or filenames should be read*)
pData : UDINT; (*pointer to the memory area where the information is copied*)
data_len : UDINT; (*length of the provided data area*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirReadEx (*reads the individual file or directory names in a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier of the directory*)
pData : UDINT; (*pointer to the memory area where the information is copied*)
data_len : UDINT; (*length of the available data area*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirInfo (*gets information about a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pPath : UDINT; (*pointer to the path (directory name)*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
dirnum : UDINT; (*number of subdirectories in this directory*)
filenum : UDINT; (*number of files in this directory*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRename (*renames directories; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the directory name*)
pNewName : UDINT; (*pointer to the new directory name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCopy (*copies a directory*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pSrcDev : UDINT; (*pointer to the source file device name*)
pSrcDir : UDINT; (*pointer to the source directory name*)
pDestDev : UDINT; (*pointer to the destination file device name*)
pDestDir : UDINT; (*pointer to the destination directory name*)
option : USINT; (*copy option*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDelete (*deletes a directory; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the directory name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDeleteEx (*deletes a directory (all files and subdirectories); asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pName : UDINT; (*pointer to the directory name*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SetAttributes (*sets attributes; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pPath : UDINT; (*pointer to the path name (file or directory)*)
attributes : USINT; (*attributes*)
option : USINT; (*set options*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetAttributes (*reads attributes; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pPath : UDINT; (*pointer to the path name (file or directory)*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
attributes : USINT; (*attributes*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevMemInfo (*determines a file device's memory information; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
freemem : UDINT; (*available disk space*)
memsize : UDINT; (*total disk space*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevLink (*creates the file device; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*new device name given as a pointer*)
pParam : UDINT; (*pointer to the link parameter*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
handle : UDINT; (*file device handle*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevUnlink (*unlinks the device; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
handle : UDINT; (*file device handle*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeLabel (*reads volume label; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
pLabel : UDINT; (*buffer for volume label given as pointer*)
labelMax : UDINT; (*size of buffer for volume label*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
labelLen : UDINT; (*length of volume label*)
END_VAR
END_FUNCTION_BLOCK
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeSerialNo (*reads volume serial nummer; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pDevice : UDINT; (*device name given as a pointer*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
serialNo : UDINT; (*volume serialNo*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION FileIoGetSysError : UINT (*reads system errors*)
END_FUNCTION

View File

@@ -0,0 +1,33 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: FileIO
* File: FileIO.typ
* Author: B+R
********************************************************************
* Data types of library FileIO
********************************************************************)
TYPE
fiDIR_READ_DATA : STRUCT (*directory read structure*)
Filename : ARRAY[0..259] OF USINT; (*file name*)
Date : DATE_AND_TIME; (*date and time*)
Filelength : UDINT; (*file length*)
END_STRUCT;
fiDIR_READ_EX_DATA : STRUCT (*directory read extended structure*)
Filename : ARRAY[0..259] OF USINT; (*file name*)
Date : DATE_AND_TIME; (*date and time*)
Filelength : UDINT; (*file length*)
Mode : UINT; (*mode*)
END_STRUCT;
fiFILE_INFO : STRUCT (*file information structure*)
size : UDINT; (*size of file [bytes]*)
linkCnt : UDINT; (*link count*)
accTime : DATE_AND_TIME; (*time of last access*)
modTime : DATE_AND_TIME; (*time of last data modification*)
chgTime : DATE_AND_TIME; (*time of last file status change*)
reserved : ARRAY[0..20] OF UDINT; (*reserved for future use*)
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,93 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: FileIO
* File: FileIO.var
* Author: B+R
********************************************************************
* Local variables of library FileIO
********************************************************************)
VAR CONSTANT
fiATTR_ARCHIVE : USINT := 32; (*attribute archive*)
fiATTR_DIRECTORY : USINT := 16; (*attribute directory*)
fiATTR_HIDDEN : USINT := 2; (*attribute hidden*)
fiATTR_RDONLY : USINT := 1; (*attribute read only*)
fiATTR_SYSTEM : USINT := 4; (*attribute system*)
fiATTR_VOL_LABEL : USINT := 8; (*attribute volume label*)
fiRECURSIVE : USINT := 1; (*option recursive*)
fiOVERWRITE : USINT := 2; (*option overwrite*)
fiREAD_ONLY : USINT := 0; (*access mode read only*)
fiWRITE_ONLY : USINT := 1; (*access mode write only*)
fiREAD_WRITE : USINT := 2; (*access mode read and write*)
fiFILE : USINT := 0; (*directory read files only*)
fiDIRECTORY : USINT := 1; (*directory read directories only*)
fiBOTH : USINT := 2; (*directory read files and directories*)
fiTruncate : UDINT := 1; (*truncate file*)
fiERR_INVALID_PATH : UINT := 20700; (*error invalid path*)
fiERR_DATA_SIZE : UINT := 20701; (*error data size*)
fiERR_NO_MORE_ENTRIES : UINT := 20702; (*error no more entries*)
fiERR_NOT_SUPPORTED : UINT := 20703; (*error not supported*)
fiERR_INVALID_TYP : UINT := 20704; (*error invalid type*)
fiERR_EXIST : UINT := 20705; (*error exist*)
fiERR_ACCESS : UINT := 20706; (*error access*)
fiERR_MODE : UINT := 20707; (*error mode*)
fiERR_FILE_NOT_FOUND : UINT := 20708; (*error file not found*)
fiERR_FILE_DEVICE : UINT := 20709; (*error file device*)
fiERR_SPACE : UINT := 20710; (*error space*)
fiERR_SEEK : UINT := 20711; (*error seek*)
fiERR_FILE : UINT := 20712; (*error file*)
fiERR_LESS_VIRTUAL_MEMORY : UINT := 20713; (*error less virtual memory*)
fiERR_COM_FILE_OPEN : UINT := 20714; (*error file open*)
fiERR_COM_FILE_CLOSE : UINT := 20715; (*error file close*)
fiERR_COM_FILE_READ : UINT := 20716; (*error file read*)
fiERR_COM_FILE_WRITE : UINT := 20717; (*error file write*)
fiERR_COM_FILE_IOCTL : UINT := 20718; (*error fiel ioctl*)
fiERR_DATA : UINT := 20719; (*error data*)
fiERR_ASYNC_MANAGER : UINT := 20720; (*error asynchron manager*)
fiERR_FILE_NOT_OPENED : UINT := 20721; (*error file not opened*)
fiERR_INVALID_DIRECTORY : UINT := 20722; (*error invalid directory*)
fiERR_DIR_NOT_EXIST : UINT := 20723; (*error directory not exists*)
fiERR_DIR_NOT_EMPTY : UINT := 20724; (*error directory not empty*)
fiERR_DIR_ALREADY_EXIST : UINT := 20725; (*error directory already exists*)
fiERR_DETMEMINFO : UINT := 20726; (*error dedect memory info*)
fiERR_NOT_ENOUGH_FREEMEM : UINT := 20727; (*error not enough free memory*)
fiERR_DIR_INVALID_HANDLE : UINT := 20728; (*error invalid directory handle*)
fiERR_PARAMETER : UINT := 20729; (*error parameter*)
fiERR_DEVICE_ALREADY_EXIST : UINT := 20730; (*error device already exists*)
fiERR_DEVICE_INVALID_HANDLE : UINT := 20731; (*error invalid device handle*)
fiERR_NETIO_IP_UNEQUAL : UINT := 20732; (*ungleiche IP bei identischem Hostnamen - IP-overwrite nicht gesetzt*)
fiERR_NETIO_PORT : UINT := 20733; (*error port not supported*)
fiERR_NETIO_USER : UINT := 20734; (*error user or password*)
fiERR_INVALID_NBYTES : UINT := 20735; (*error invalid number of bytes*)
fiERR_INIT : UINT := 20796; (*error init*)
fiERR_DEVICE_DRIVER : UINT := 20797; (*error device driver*)
fiERR_DEVICE_MANAGER : UINT := 20798; (*error device manager*)
fiERR_SYSTEM : UINT := 20799; (*error system*)
ATTR_ARCHIVE : USINT := 32; (*obsolete*)
ATTR_DIRECTORY : USINT := 16; (*obsolete*)
ATTR_HIDDEN : USINT := 2; (*obsolete*)
ATTR_RDONLY : USINT := 1; (*obsolete*)
ATTR_SYSTEM : USINT := 4; (*obsolete*)
ATTR_VOL_LABEL : USINT := 8; (*obsolete*)
DIR_OW : USINT := 1; (*obsolete*)
FILE_ALL : USINT := 2; (*obsolete*)
FILE_DIR : USINT := 1; (*obsolete*)
FILE_FILE : USINT := 0; (*obsolete*)
FILE_ONCE : USINT := 0; (*obsolete*)
FILE_DETMEM : USINT := 1; (*obsolete*)
FILE_OW_DETMEM : USINT := 2; (*obsolete*)
FILE_OW_ONCE : USINT := 3; (*obsolete*)
FILE_R : USINT := 0; (*obsolete*)
FILE_W : USINT := 1; (*obsolete*)
FILE_RW : USINT := 2; (*obsolete*)
SET_RECURSIVE : USINT := 1; (*obsolete*)
END_VAR

View File

@@ -0,0 +1,708 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _FILEIO_
#define _FILEIO_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define SET_RECURSIVE 1U
#define FILE_RW 2U
#define FILE_W 1U
#define FILE_R 0U
#define FILE_OW_ONCE 3U
#define FILE_OW_DETMEM 2U
#define FILE_DETMEM 1U
#define FILE_ONCE 0U
#define FILE_FILE 0U
#define FILE_DIR 1U
#define FILE_ALL 2U
#define DIR_OW 1U
#define ATTR_VOL_LABEL 8U
#define ATTR_SYSTEM 4U
#define ATTR_RDONLY 1U
#define ATTR_HIDDEN 2U
#define ATTR_DIRECTORY 16U
#define ATTR_ARCHIVE 32U
#define fiERR_SYSTEM 20799U
#define fiERR_DEVICE_MANAGER 20798U
#define fiERR_DEVICE_DRIVER 20797U
#define fiERR_INIT 20796U
#define fiERR_INVALID_NBYTES 20735U
#define fiERR_NETIO_USER 20734U
#define fiERR_NETIO_PORT 20733U
#define fiERR_NETIO_IP_UNEQUAL 20732U
#define fiERR_DEVICE_INVALID_HANDLE 20731U
#define fiERR_DEVICE_ALREADY_EXIST 20730U
#define fiERR_PARAMETER 20729U
#define fiERR_DIR_INVALID_HANDLE 20728U
#define fiERR_NOT_ENOUGH_FREEMEM 20727U
#define fiERR_DETMEMINFO 20726U
#define fiERR_DIR_ALREADY_EXIST 20725U
#define fiERR_DIR_NOT_EMPTY 20724U
#define fiERR_DIR_NOT_EXIST 20723U
#define fiERR_INVALID_DIRECTORY 20722U
#define fiERR_FILE_NOT_OPENED 20721U
#define fiERR_ASYNC_MANAGER 20720U
#define fiERR_DATA 20719U
#define fiERR_COM_FILE_IOCTL 20718U
#define fiERR_COM_FILE_WRITE 20717U
#define fiERR_COM_FILE_READ 20716U
#define fiERR_COM_FILE_CLOSE 20715U
#define fiERR_COM_FILE_OPEN 20714U
#define fiERR_LESS_VIRTUAL_MEMORY 20713U
#define fiERR_FILE 20712U
#define fiERR_SEEK 20711U
#define fiERR_SPACE 20710U
#define fiERR_FILE_DEVICE 20709U
#define fiERR_FILE_NOT_FOUND 20708U
#define fiERR_MODE 20707U
#define fiERR_ACCESS 20706U
#define fiERR_EXIST 20705U
#define fiERR_INVALID_TYP 20704U
#define fiERR_NOT_SUPPORTED 20703U
#define fiERR_NO_MORE_ENTRIES 20702U
#define fiERR_DATA_SIZE 20701U
#define fiERR_INVALID_PATH 20700U
#define fiTruncate 1U
#define fiBOTH 2U
#define fiDIRECTORY 1U
#define fiFILE 0U
#define fiREAD_WRITE 2U
#define fiWRITE_ONLY 1U
#define fiREAD_ONLY 0U
#define fiOVERWRITE 2U
#define fiRECURSIVE 1U
#define fiATTR_VOL_LABEL 8U
#define fiATTR_SYSTEM 4U
#define fiATTR_RDONLY 1U
#define fiATTR_HIDDEN 2U
#define fiATTR_DIRECTORY 16U
#define fiATTR_ARCHIVE 32U
#else
#ifndef _GLOBAL_CONST
#define _GLOBAL_CONST _WEAK const
#endif
_GLOBAL_CONST unsigned char SET_RECURSIVE;
_GLOBAL_CONST unsigned char FILE_RW;
_GLOBAL_CONST unsigned char FILE_W;
_GLOBAL_CONST unsigned char FILE_R;
_GLOBAL_CONST unsigned char FILE_OW_ONCE;
_GLOBAL_CONST unsigned char FILE_OW_DETMEM;
_GLOBAL_CONST unsigned char FILE_DETMEM;
_GLOBAL_CONST unsigned char FILE_ONCE;
_GLOBAL_CONST unsigned char FILE_FILE;
_GLOBAL_CONST unsigned char FILE_DIR;
_GLOBAL_CONST unsigned char FILE_ALL;
_GLOBAL_CONST unsigned char DIR_OW;
_GLOBAL_CONST unsigned char ATTR_VOL_LABEL;
_GLOBAL_CONST unsigned char ATTR_SYSTEM;
_GLOBAL_CONST unsigned char ATTR_RDONLY;
_GLOBAL_CONST unsigned char ATTR_HIDDEN;
_GLOBAL_CONST unsigned char ATTR_DIRECTORY;
_GLOBAL_CONST unsigned char ATTR_ARCHIVE;
_GLOBAL_CONST unsigned short fiERR_SYSTEM;
_GLOBAL_CONST unsigned short fiERR_DEVICE_MANAGER;
_GLOBAL_CONST unsigned short fiERR_DEVICE_DRIVER;
_GLOBAL_CONST unsigned short fiERR_INIT;
_GLOBAL_CONST unsigned short fiERR_INVALID_NBYTES;
_GLOBAL_CONST unsigned short fiERR_NETIO_USER;
_GLOBAL_CONST unsigned short fiERR_NETIO_PORT;
_GLOBAL_CONST unsigned short fiERR_NETIO_IP_UNEQUAL;
_GLOBAL_CONST unsigned short fiERR_DEVICE_INVALID_HANDLE;
_GLOBAL_CONST unsigned short fiERR_DEVICE_ALREADY_EXIST;
_GLOBAL_CONST unsigned short fiERR_PARAMETER;
_GLOBAL_CONST unsigned short fiERR_DIR_INVALID_HANDLE;
_GLOBAL_CONST unsigned short fiERR_NOT_ENOUGH_FREEMEM;
_GLOBAL_CONST unsigned short fiERR_DETMEMINFO;
_GLOBAL_CONST unsigned short fiERR_DIR_ALREADY_EXIST;
_GLOBAL_CONST unsigned short fiERR_DIR_NOT_EMPTY;
_GLOBAL_CONST unsigned short fiERR_DIR_NOT_EXIST;
_GLOBAL_CONST unsigned short fiERR_INVALID_DIRECTORY;
_GLOBAL_CONST unsigned short fiERR_FILE_NOT_OPENED;
_GLOBAL_CONST unsigned short fiERR_ASYNC_MANAGER;
_GLOBAL_CONST unsigned short fiERR_DATA;
_GLOBAL_CONST unsigned short fiERR_COM_FILE_IOCTL;
_GLOBAL_CONST unsigned short fiERR_COM_FILE_WRITE;
_GLOBAL_CONST unsigned short fiERR_COM_FILE_READ;
_GLOBAL_CONST unsigned short fiERR_COM_FILE_CLOSE;
_GLOBAL_CONST unsigned short fiERR_COM_FILE_OPEN;
_GLOBAL_CONST unsigned short fiERR_LESS_VIRTUAL_MEMORY;
_GLOBAL_CONST unsigned short fiERR_FILE;
_GLOBAL_CONST unsigned short fiERR_SEEK;
_GLOBAL_CONST unsigned short fiERR_SPACE;
_GLOBAL_CONST unsigned short fiERR_FILE_DEVICE;
_GLOBAL_CONST unsigned short fiERR_FILE_NOT_FOUND;
_GLOBAL_CONST unsigned short fiERR_MODE;
_GLOBAL_CONST unsigned short fiERR_ACCESS;
_GLOBAL_CONST unsigned short fiERR_EXIST;
_GLOBAL_CONST unsigned short fiERR_INVALID_TYP;
_GLOBAL_CONST unsigned short fiERR_NOT_SUPPORTED;
_GLOBAL_CONST unsigned short fiERR_NO_MORE_ENTRIES;
_GLOBAL_CONST unsigned short fiERR_DATA_SIZE;
_GLOBAL_CONST unsigned short fiERR_INVALID_PATH;
_GLOBAL_CONST unsigned long fiTruncate;
_GLOBAL_CONST unsigned char fiBOTH;
_GLOBAL_CONST unsigned char fiDIRECTORY;
_GLOBAL_CONST unsigned char fiFILE;
_GLOBAL_CONST unsigned char fiREAD_WRITE;
_GLOBAL_CONST unsigned char fiWRITE_ONLY;
_GLOBAL_CONST unsigned char fiREAD_ONLY;
_GLOBAL_CONST unsigned char fiOVERWRITE;
_GLOBAL_CONST unsigned char fiRECURSIVE;
_GLOBAL_CONST unsigned char fiATTR_VOL_LABEL;
_GLOBAL_CONST unsigned char fiATTR_SYSTEM;
_GLOBAL_CONST unsigned char fiATTR_RDONLY;
_GLOBAL_CONST unsigned char fiATTR_HIDDEN;
_GLOBAL_CONST unsigned char fiATTR_DIRECTORY;
_GLOBAL_CONST unsigned char fiATTR_ARCHIVE;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct fiDIR_READ_DATA
{ unsigned char Filename[260];
plcdt Date;
unsigned long Filelength;
} fiDIR_READ_DATA;
typedef struct fiDIR_READ_EX_DATA
{ unsigned char Filename[260];
plcdt Date;
unsigned long Filelength;
unsigned short Mode;
} fiDIR_READ_EX_DATA;
typedef struct fiFILE_INFO
{ unsigned long size;
unsigned long linkCnt;
plcdt accTime;
plcdt modTime;
plcdt chgTime;
unsigned long reserved[21];
} fiFILE_INFO;
typedef struct FileCreate
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pFile;
/* 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;
} FileCreate_typ;
typedef struct FileOpen
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pFile;
unsigned char mode;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
unsigned long filelen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} FileOpen_typ;
typedef struct FileClose
{
/* 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;
} FileClose_typ;
typedef struct FileRead
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long offset;
unsigned long pDest;
unsigned long len;
/* 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;
} FileRead_typ;
typedef struct FileReadEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long offset;
unsigned long pDest;
unsigned long len;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long bytesread;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} FileReadEx_typ;
typedef struct FileWrite
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long offset;
unsigned long pSrc;
unsigned long len;
/* 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;
} FileWrite_typ;
typedef struct FileWriteEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long offset;
unsigned long pSrc;
unsigned long len;
unsigned long option;
/* 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;
} FileWriteEx_typ;
typedef struct FileRename
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
unsigned long pNewName;
/* 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;
} FileRename_typ;
typedef struct FileCopy
{
/* VAR_INPUT (analog) */
unsigned long pSrcDev;
unsigned long pSrc;
unsigned long pDestDev;
unsigned long pDest;
unsigned char option;
/* 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;
} FileCopy_typ;
typedef struct FileDelete
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
/* 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;
} FileDelete_typ;
typedef struct FileInfo
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
unsigned long pInfo;
/* 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;
} FileInfo_typ;
typedef struct FileTruncate
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
unsigned long newLength;
/* 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;
} FileTruncate_typ;
typedef struct DirCreate
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
/* 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;
} DirCreate_typ;
typedef struct DirOpen
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
/* 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;
} DirOpen_typ;
typedef struct DirClose
{
/* 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;
} DirClose_typ;
typedef struct DirRead
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pPath;
unsigned long entry;
unsigned char option;
unsigned long pData;
unsigned long data_len;
/* 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;
} DirRead_typ;
typedef struct DirReadEx
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pData;
unsigned long data_len;
/* 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;
} DirReadEx_typ;
typedef struct DirInfo
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pPath;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long dirnum;
unsigned long filenum;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} DirInfo_typ;
typedef struct DirRename
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
unsigned long pNewName;
/* 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;
} DirRename_typ;
typedef struct DirCopy
{
/* VAR_INPUT (analog) */
unsigned long pSrcDev;
unsigned long pSrcDir;
unsigned long pDestDev;
unsigned long pDestDir;
unsigned char option;
/* 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;
} DirCopy_typ;
typedef struct DirDelete
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
/* 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;
} DirDelete_typ;
typedef struct DirDeleteEx
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pName;
/* 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;
} DirDeleteEx_typ;
typedef struct SetAttributes
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pPath;
unsigned char attributes;
unsigned char option;
/* 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;
} SetAttributes_typ;
typedef struct GetAttributes
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pPath;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned char attributes;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} GetAttributes_typ;
typedef struct DevMemInfo
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long freemem;
unsigned long memsize;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} DevMemInfo_typ;
typedef struct DevLink
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pParam;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long handle;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} DevLink_typ;
typedef struct DevUnlink
{
/* VAR_INPUT (analog) */
unsigned long handle;
/* 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;
} DevUnlink_typ;
typedef struct GetVolumeLabel
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
unsigned long pLabel;
unsigned long labelMax;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long labelLen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} GetVolumeLabel_typ;
typedef struct GetVolumeSerialNo
{
/* VAR_INPUT (analog) */
unsigned long pDevice;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long serialNo;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} GetVolumeSerialNo_typ;
/* Prototyping of functions and function blocks */
_BUR_PUBLIC void FileCreate(struct FileCreate* inst);
_BUR_PUBLIC void FileOpen(struct FileOpen* inst);
_BUR_PUBLIC void FileClose(struct FileClose* inst);
_BUR_PUBLIC void FileRead(struct FileRead* inst);
_BUR_PUBLIC void FileReadEx(struct FileReadEx* inst);
_BUR_PUBLIC void FileWrite(struct FileWrite* inst);
_BUR_PUBLIC void FileWriteEx(struct FileWriteEx* inst);
_BUR_PUBLIC void FileRename(struct FileRename* inst);
_BUR_PUBLIC void FileCopy(struct FileCopy* inst);
_BUR_PUBLIC void FileDelete(struct FileDelete* inst);
_BUR_PUBLIC void FileInfo(struct FileInfo* inst);
_BUR_PUBLIC void FileTruncate(struct FileTruncate* inst);
_BUR_PUBLIC void DirCreate(struct DirCreate* inst);
_BUR_PUBLIC void DirOpen(struct DirOpen* inst);
_BUR_PUBLIC void DirClose(struct DirClose* inst);
_BUR_PUBLIC void DirRead(struct DirRead* inst);
_BUR_PUBLIC void DirReadEx(struct DirReadEx* inst);
_BUR_PUBLIC void DirInfo(struct DirInfo* inst);
_BUR_PUBLIC void DirRename(struct DirRename* inst);
_BUR_PUBLIC void DirCopy(struct DirCopy* inst);
_BUR_PUBLIC void DirDelete(struct DirDelete* inst);
_BUR_PUBLIC void DirDeleteEx(struct DirDeleteEx* inst);
_BUR_PUBLIC void SetAttributes(struct SetAttributes* inst);
_BUR_PUBLIC void GetAttributes(struct GetAttributes* inst);
_BUR_PUBLIC void DevMemInfo(struct DevMemInfo* inst);
_BUR_PUBLIC void DevLink(struct DevLink* inst);
_BUR_PUBLIC void DevUnlink(struct DevUnlink* inst);
_BUR_PUBLIC void GetVolumeLabel(struct GetVolumeLabel* inst);
_BUR_PUBLIC void GetVolumeSerialNo(struct GetVolumeSerialNo* inst);
_BUR_PUBLIC unsigned short FileIoGetSysError(void);
#ifdef __cplusplus
};
#endif
#endif /* _FILEIO_ */

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=4.3.4.121 SP?>
<Library Version="1.62.1" Description="Advanced alarm management" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>MpAlarmX.typ</File>
<File>MpAlarmXError.typ</File>
<File>MpAlarmX.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="MpBase" FromVersion="5.00.0" ToVersion="5.00.9" />
<Dependency ObjectName="MpCom" FromVersion="1.62.1" ToVersion="1.62.1" />
<Dependency ObjectName="astime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,189 @@
(*Core Function Blocks*)
FUNCTION_BLOCK MpAlarmXCore (*mapp component for advanced centralized alarm collection and management*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
ActiveAlarms : UDINT; (*Number of alarms which are currently active*) (* *) (*#CMD#;*)
PendingAlarms : UDINT; (*Number of alarms which are currently pending (either active, or not yet acknowleged)*) (* *) (*#CMD#;*)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType; (*Internal data*) (* *) (*#OMIT#;*)
END_VAR
END_FUNCTION_BLOCK
(*UI Function Blocks*)
FUNCTION_BLOCK MpAlarmXListUI (*add-on function block that provides VC4 connection datapoints to display the currently active alarms in a list*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
UISetup : MpAlarmXListUISetupType; (*Setup UI connection - must be configured before enabling the FB*) (* *) (*#PAR#;*)
UIConnect : REFERENCE TO MpAlarmXListUIConnectType; (*UI connection datapoints*) (* *) (*#CMD#;*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType; (*Internal data*) (* *) (*#OMIT#;*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK MpAlarmXHistoryUI (*add-on function block that provides VC4 connection datapoints to display the alarm history in a list*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
UISetup : MpAlarmXHistoryUISetupType; (*Setup UI connection - must be configured before enabling the FB*) (* *) (*#PAR#;*)
UIConnect : REFERENCE TO MpAlarmXHistoryUIConnectType; (*UI connection datapoints*) (* *) (*#CMD#;*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType; (*Internal data*) (* *) (*#OMIT#;*)
END_VAR
END_FUNCTION_BLOCK
(*General add-ons*)
FUNCTION MpAlarmXCheckState : BOOL (*Add-on function which checks whether an alarm is currently in a certain state*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Name : STRING[255]; (*Unique Identifier of the alarm*) (* *) (*#PAR#;*)
State : MpAlarmXStateEnum; (*Check whether the alarm is currently in this state*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXCheckStateID : BOOL (*Add-on function which checks whether an alarm is currently in a certain state*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
InstanceID : UDINT; (*Instance ID of the alarm that should be checked for its state*) (* *) (*#PAR#;*)
State : MpAlarmXStateEnum; (*Check whether the alarm is currently in this state*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXCheckReaction : BOOL (*Add-on function which checks whether a certain reaction is currently active, returns TRUE if at least one alarm is currently active that requires this reaction*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Name : STRING[255]; (*Unique name of the reaction*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXSet : UDINT (*Add-On function to set (raise) a user alarm. By calling this function the alarm system is informed that a specific alarm is active. Returns InstanceID of the alarm that was set.*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Name : STRING[255]; (*Unique name of the alarm*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXAcknowledge : DINT (*Add-On function to acknowledge an alarm. By calling this function the alarm system is informed that the operator has acknowledged an alarm. Returns result code.*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Name : STRING[255]; (*Unique name of the alarm*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXAcknowledgeID : DINT (*Add-On function to acknowledge an alarm. By calling this function the alarm system is informed that the operator has acknowledged an alarm. Returns result code.*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
InstanceID : UDINT; (*Instance ID of the alarm that should be acknowledged*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXReset : DINT (*Add-On function to reset a user alarm. By calling this function the alarm system is informed that a specific alarm is inactive. Returns result code.*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Name : STRING[255]; (*Unique name of the alarm*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
FUNCTION MpAlarmXResetID : DINT (*Add-On function to reset a user alarm. By calling this function the alarm system is informed that a specific alarm is inactive. Returns result code.*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
InstanceID : UDINT; (*Instance ID of the alarm that should be reset*) (* *) (*#PAR#;*)
END_VAR
END_FUNCTION
(*History add-ons*)
FUNCTION_BLOCK MpAlarmXHistory (*Historical recording of all alarm related events*) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
DeviceName : REFERENCE TO STRING[50]; (*Name of device to export the alarm history to*) (* *) (*#CMD#;*)
Language : REFERENCE TO STRING[20]; (*Language ID that should be used when exporting data*) (* *) (*#CMD#OPT#;*)
Export : BOOL; (*Save the current alarm history data (since last archiving) to the given file device (as a human-readable file)*) (* *) (*#CMD#;*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
CommandBusy : BOOL; (*Function block is busy processing a command.*) (* *) (*#CMD#OPT#;*)
CommandDone : BOOL; (*Command has finished and was successful.*) (* *) (*#CMD#;*)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType;
END_VAR
END_FUNCTION_BLOCK
(*Configuration add-ons*)
FUNCTION_BLOCK MpAlarmXConfigAlarm (*add-on function block that allows to load and save alarm configurations *) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
Name : REFERENCE TO STRING[255]; (*Unique Identifier of the alarm*) (* *) (*#PAR#;*)
Configuration : REFERENCE TO MpAlarmXAlarmConfigType; (*Configuration parameters (mapp standard interface)*) (* *) (*#PAR#;*)
Load : BOOL; (*Read configuration from AR into the config structure*) (* *) (*#CMD#*)
Save : BOOL; (*Write configuration from config structure to AR*) (* *) (*#CMD#*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
CommandBusy : BOOL; (*Function block is busy processing a command.*) (* *) (*#CMD#OPT#;*)
CommandDone : BOOL; (*Command has finished and was successful.*) (* *) (*#CMD#*)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType; (*Internal data*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK MpAlarmXConfigMapping (*add-on function block that allows to load and save mapping configurations *) (* $GROUP=mapp,$CAT=Alarm System,$GROUPICON=Icon_mapp.png,$CATICON=Icon_MpAlarmX.png *)
VAR_INPUT
MpLink : REFERENCE TO MpComIdentType; (*Incoming communication handle (mapp standard interface)*) (* *) (*#PAR#;*)
Enable : BOOL; (*Enables/Disables the function block (mapp standard interface)*) (* *) (*#PAR#;*)
ErrorReset : BOOL; (*Resets all function block errors (mapp standard interface)*) (* *) (*#PAR#;*)
Type : MpAlarmXMappingTypeEnum; (*Type of the mapping (Alarm Name, Severity or Default)*) (* *) (*#PAR#;*)
Name : REFERENCE TO STRING[255]; (*Name (meaning depends on the Type setting)*) (* *) (*#PAR#;*)
Configuration : REFERENCE TO MpAlarmXMappingConfigType; (*Configuration parameters (mapp standard interface)*) (* *) (*#PAR#;*)
Load : BOOL; (*Read configuration from AR into the config structure*) (* *) (*#CMD#*)
Save : BOOL; (*Write configuration from config structure to AR*) (* *) (*#CMD#*)
END_VAR
VAR_OUTPUT
Active : BOOL; (*Function block is active (mapp standard interface)*) (* *) (*#PAR#;*)
Error : BOOL; (*Indicates an error (mapp standard interface)*) (* *) (*#PAR#;*)
StatusID : DINT; (*Error/Status information (mapp standard interface)*) (* *) (*#PAR#; *)
CommandBusy : BOOL; (*Function block is busy processing a command.*) (* *) (*#CMD#OPT#;*)
CommandDone : BOOL; (*Command has finished and was successful.*) (* *) (*#CMD#*)
Info : MpAlarmXInfoType; (*Additional information*) (* *) (*#CMD#;*)
END_VAR
VAR
Internal : {REDUND_UNREPLICABLE} MpComInternalDataType; (*Internal data*)
END_VAR
END_FUNCTION_BLOCK

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