Inbetriebnahmestand nach Kameraumbau
This commit is contained in:
16
KD_Hofer_Powertrain.apj
Normal file
16
KD_Hofer_Powertrain.apj
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version="4.7.5.60 SP"?>
|
||||
<Project Description="Hofer" Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
|
||||
<Communication>
|
||||
<OnlineConfiguration Name="Hofer-Powertrain" DeviceType="TCPIP" DeviceParameters="/IF=tcpip /LOPO=11159 /SA=56" ConnectionParameters="/COMT=2500 /RT=1000 /AM=* /SDT=5 /DAIP=192.168.1.82 /REPO=11159 /ANSL=1 /PT=11169" Description="" />
|
||||
</Communication>
|
||||
<ANSIC DefaultIncludes="true" />
|
||||
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
|
||||
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
|
||||
<Project StoreRuntimeInProject="false" />
|
||||
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
|
||||
<TechnologyPackages>
|
||||
<mapp Version="5.10.1" />
|
||||
<TextSystem udbdef="0.1.0" />
|
||||
</TechnologyPackages>
|
||||
</Project>
|
||||
8
LastUser.set
Normal file
8
LastUser.set
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version="4.7.5.60 SP"?>
|
||||
<ProjectSettings xmlns="http://br-automation.co.at/AS/ProjectSettings">
|
||||
<ConfigurationManager ActiveConfigurationName="Config1" />
|
||||
<Deployment Value="ActiveCpu" />
|
||||
<ExportProject ExportFilePath="D:\src44\KD_Hoertnagel_Fraese\KD_Hoertnagel_Fraese.zip" />
|
||||
<Print Footer="%cPage: %p" Header="%lProject: %n%c%x" />
|
||||
</ProjectSettings>
|
||||
8
Logical/Common/GlobalCommon.typ
Normal file
8
Logical/Common/GlobalCommon.typ
Normal 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
|
||||
24
Logical/Common/GlobalComon.var
Normal file
24
Logical/Common/GlobalComon.var
Normal 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
|
||||
10
Logical/Common/Package.pkg
Normal file
10
Logical/Common/Package.pkg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.2.3.159?>
|
||||
<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>
|
||||
9
Logical/Common/blinker/IEC.prg
Normal file
9
Logical/Common/blinker/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.2.3.159?>
|
||||
<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>
|
||||
13
Logical/Common/blinker/blinker.var
Normal file
13
Logical/Common/blinker/blinker.var
Normal 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
|
||||
30
Logical/Common/blinker/blinkerCyclic.ab
Normal file
30
Logical/Common/blinker/blinkerCyclic.ab
Normal 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
|
||||
16
Logical/Common/blinker/blinkerInit.ab
Normal file
16
Logical/Common/blinker/blinkerInit.ab
Normal 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
|
||||
|
||||
9
Logical/Common/get_dt/IEC.prg
Normal file
9
Logical/Common/get_dt/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.2.3.159?>
|
||||
<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>
|
||||
6
Logical/Common/get_dt/get_dt.var
Normal file
6
Logical/Common/get_dt/get_dt.var
Normal file
@@ -0,0 +1,6 @@
|
||||
VAR
|
||||
sTemp : STRING[10] := '';
|
||||
lDTStructureGetTime : DTStructureGetTime := (0);
|
||||
lDTGetTime : DTGetTime := (0);
|
||||
lTimeStructure : TIMEStructure := (0);
|
||||
END_VAR
|
||||
57
Logical/Common/get_dt/get_dtCyclic.ab
Normal file
57
Logical/Common/get_dt/get_dtCyclic.ab
Normal 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
|
||||
|
||||
4
Logical/Common/get_dt/get_dtInit.ab
Normal file
4
Logical/Common/get_dt/get_dtInit.ab
Normal file
@@ -0,0 +1,4 @@
|
||||
PROGRAM _INIT
|
||||
(* init program *)
|
||||
END_PROGRAM
|
||||
|
||||
147
Logical/Communication/ABBCom/ABBCom.st
Normal file
147
Logical/Communication/ABBCom/ABBCom.st
Normal file
@@ -0,0 +1,147 @@
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
//Zeiger auf Roboter Stellen (Zyklisch wg. Download)
|
||||
lABBRobot ACCESS ADR (gABBRobot1);
|
||||
|
||||
//Dynamische Variablen initialisieren
|
||||
|
||||
//Lifebeat erzeugen
|
||||
lABBRobot.Out.bLifebeat := bBlink0_5;
|
||||
|
||||
//Eing<EFBFBD>nge von Roboter
|
||||
//============================================================
|
||||
//Eingangs Byte 0 (0-7)
|
||||
TON_Motors_On.IN := dpInByte[0].0;
|
||||
TON_Motors_On.PT := t#1200ms;
|
||||
TON_Motors_On ();
|
||||
lABBRobot.In.bMotorsOn := TON_Motors_On.Q;
|
||||
lABBRobot.In.bMotorsOff := dpInByte[0].1;
|
||||
lABBRobot.In.bProgramRun := dpInByte[0].2;
|
||||
lABBRobot.In.bEStop := dpInByte[0].3;
|
||||
lABBRobot.In.bAutomatic := dpInByte[0].4;
|
||||
lABBRobot.In.bError := dpInByte[0].5;
|
||||
lABBRobot.In.bRunChainOk := dpInByte[0].6;
|
||||
lABBRobot.In.bLifebeat := dpInByte[0].7;
|
||||
IF EDGE (lABBRobot.In.bLifebeat) THEN
|
||||
TON_Lifebeat.IN := FALSE;
|
||||
ELSE
|
||||
TON_Lifebeat.IN := TRUE;
|
||||
END_IF;
|
||||
TON_Lifebeat.PT := t#750ms;
|
||||
TON_Lifebeat ();
|
||||
lABBRobot.bOnline := NOT TON_Lifebeat.Q;
|
||||
|
||||
//Eingangs Byte 1 (8-15)
|
||||
lABBRobot.In.bMotionSupervisionTriggered := dpInByte[1].0;
|
||||
|
||||
|
||||
//Eingangs Byte 2 (16-23)
|
||||
//Greifer 1 <EFBFBD>ffnen
|
||||
gCmd1.Gripper1.FromRobot.bOpenGripper := dpInByte[2].0;
|
||||
|
||||
//Greifer 1 Schlie<EFBFBD>en
|
||||
gCmd1.Gripper1.FromRobot.bCloseGripper := dpInByte[2].1;
|
||||
|
||||
//Kamera triggern
|
||||
gCmd1.Cam.FromRobot.bTriggerCamHole := dpInByte[2].2;
|
||||
|
||||
//R<EFBFBD>ckmeldungen
|
||||
gCmd1.Robot.FromRobot.bPickedPart := dpInByte[2].3;
|
||||
gCmd1.Robot.FromRobot.bPlacedPartInLoadBox := dpInByte[2].4;
|
||||
gCmd1.Robot.FromRobot.bErrorPickPart := dpInByte[2].5;
|
||||
gCmd1.Robot.FromRobot.bErrorPlacePart := dpInByte[2].6;
|
||||
|
||||
//Kamera f<EFBFBD>r Text triggern
|
||||
gCmd1.Cam.FromRobot.bTriggerCamID := dpInByte[2].7;
|
||||
|
||||
|
||||
//Eingangs Byte 3 (24-31)
|
||||
lABBRobot.In.bWZHome := dpInByte[3].0;
|
||||
lABBRobot.In.bWZChangetool := dpInByte[3].1;
|
||||
lABBRobot.In.bWZPlacepoint := dpInByte[3].2;
|
||||
//gCmd1.FeederRobFeed.RobfeedToFd.bRobotInPlacepos := dpInByte[3].2;
|
||||
|
||||
//Roboter in Bereich Flexfeeder (nur lokal wg. Homing benutzt
|
||||
//dpInByte[3].6
|
||||
|
||||
|
||||
//Eingangs Byte 4 (32-39)
|
||||
|
||||
// lABBRobot.In.uiRotationPos := SHL (USINT_TO_UINT (dpInByte[4]), 8) + USINT_TO_UINT (dpInByte[4]);
|
||||
//Eingangs Byte 5 (40-47)
|
||||
lABBRobot.In.usStatus := dpInByte[5];
|
||||
|
||||
|
||||
//Eingangs Byte 6 (48-55)
|
||||
//Zuf<EFBFBD>hrung Roboter hat neues Teil abgeholt
|
||||
|
||||
//Nietstation Roboter hat neues Bauteil eingelegt
|
||||
//gCmd1.RivotRob.RobToRivot.bPlacedPart := dpInByte[6].1;
|
||||
|
||||
|
||||
//Eingangs Byte 7 (56-63)
|
||||
//Eingangs Byte 8 (64-71)
|
||||
//Eingangs Byte 9 (72-80)
|
||||
//Eingangs Byte 10 (81-88)
|
||||
//Eingangs Byte 11 (89-96)
|
||||
//Eingangs Byte 12 (97-104)
|
||||
//Eingangs Byte 13 (105-112)
|
||||
//Eingangs Byte 14 (113-120)
|
||||
//Eingangs Byte 15 (121-128)
|
||||
|
||||
//Ausg<EFBFBD>nge an Roboter
|
||||
//============================================================
|
||||
//Ausgangs Byte 0 (0-7)
|
||||
TOF_Reset_EStop.IN := lABBRobot.Out.bResetEStop;
|
||||
TOF_Reset_EStop.PT := t#400ms;
|
||||
TOF_Reset_EStop ();
|
||||
dpOutByte[0].0 := lABBRobot.Out.bSwitchMotorOn;
|
||||
dpOutByte[0].1 := lABBRobot.Out.bSwitchMotorOff;
|
||||
dpOutByte[0].2 := lABBRobot.Out.bStart;
|
||||
dpOutByte[0].3 := lABBRobot.Out.bStop;
|
||||
dpOutByte[0].4 := TOF_Reset_EStop.Q;
|
||||
dpOutByte[0].5 := lABBRobot.Out.bResetError;
|
||||
dpOutByte[0].6 := lABBRobot.Out.bStartAtMain;
|
||||
dpOutByte[0].7 := lABBRobot.Out.bLifebeat;
|
||||
|
||||
//Ausgangs Byte 1 (8-15)
|
||||
dpOutByte[1].0 := FALSE; //Automatik irrelevant
|
||||
dpOutByte[1].1 := lABBRobot.Out.bStartBackup;
|
||||
|
||||
//Ausgangs Byte 2 (16-23)
|
||||
|
||||
dpOutByte[2].0 := gCmd1.Gripper1.ToRobot.bGripperIsOpen;
|
||||
dpOutByte[2].1 := gCmd1.Gripper1.ToRobot.bGripperIsClosed;
|
||||
|
||||
//Sensor
|
||||
dpOutByte[2].2 := bInPartSearchRaw;
|
||||
dpOutByte[2].3 := bInPartSearchFine;
|
||||
//Ergebnis Kamera
|
||||
dpOutByte[2].4 := gCmd1.Cam.ToRobot.bPartOk; //Korrektes Teil
|
||||
dpOutByte[2].5 := gCmd1.Cam.ToRobot.bPartNoK; //Falsches Teil
|
||||
dpOutByte[2].6 := gCmd1.Cam.ToRobot.bIDOk; //Korrektes Teil
|
||||
dpOutByte[2].7 := gCmd1.Cam.ToRobot.bIDNoK; //Falsches Teil
|
||||
|
||||
|
||||
//Ausgangs Byte 3 (24-31)
|
||||
|
||||
//Ausgangs Byte 4 (32-39)
|
||||
|
||||
//Ausgangs Byte 5 (40-47)
|
||||
dpOutByte[5] := lABBRobot.Out.usProgNr;
|
||||
//Ausgangs Byte 6 (48-55)
|
||||
dpOutByte[6] := gCmd1.Robot.ToRobot.usPartsInUnLoadBox;
|
||||
//Ausgangs Byte 7 (56-63)
|
||||
dpOutByte[7] := gCmd1.Robot.ToRobot.usPartsInLoadBox;
|
||||
//Ausgangs Byte 8 (64-71)
|
||||
dpOutByte[8] := gCmd1.usPartVariant;
|
||||
//Ausgangs Byte 9 (72-79)
|
||||
|
||||
//Ausgangs Byte 10 (80-87)
|
||||
//Ausgangs Byte 11 (88-95)
|
||||
//Ausgangs Byte 12 (96-103)
|
||||
//Ausgangs Byte 13 (104-111)
|
||||
//Ausgangs Byte 14 (112-119)
|
||||
//Ausgangs Byte 15 (120-127)
|
||||
|
||||
END_PROGRAM
|
||||
8
Logical/Communication/ABBCom/ABBCom.var
Normal file
8
Logical/Communication/ABBCom/ABBCom.var
Normal file
@@ -0,0 +1,8 @@
|
||||
VAR
|
||||
lABBRobot : REFERENCE TO gtyp_ABBInterface; (*Referenz to ABB Standard Interface*)
|
||||
dpOutByte : ARRAY[0..15] OF USINT := [16(0)]; (*Raw Output Bytes Abb Interface*)
|
||||
dpInByte : ARRAY[0..15] OF USINT := [16(0)]; (*Raw Input Bytes Abb Interface*)
|
||||
TOF_Reset_EStop : TOF;
|
||||
TON_Motors_On : TON;
|
||||
TON_Lifebeat : TON;
|
||||
END_VAR
|
||||
2
Logical/Communication/ABBCom/ABBComInit.st
Normal file
2
Logical/Communication/ABBCom/ABBComInit.st
Normal file
@@ -0,0 +1,2 @@
|
||||
PROGRAM _INIT
|
||||
END_PROGRAM
|
||||
10
Logical/Communication/ABBCom/IEC.prg
Normal file
10
Logical/Communication/ABBCom/IEC.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.7.4.67 SP?>
|
||||
<Program SubType="IEC" xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Implementation code">ABBComInit.st</File>
|
||||
<File Description="Implementation code">ABBCom.st</File>
|
||||
<File Description="Local variables" Private="true">ABBCom.var</File>
|
||||
<File Description="Local variables" Private="true">IOs.var</File>
|
||||
</Files>
|
||||
</Program>
|
||||
5
Logical/Communication/ABBCom/IOs.var
Normal file
5
Logical/Communication/ABBCom/IOs.var
Normal file
@@ -0,0 +1,5 @@
|
||||
(*//Roboter*)
|
||||
VAR
|
||||
bInPartSearchRaw : BOOL;
|
||||
bInPartSearchFine : BOOL;
|
||||
END_VAR
|
||||
36
Logical/Communication/GlobalCom.typ
Normal file
36
Logical/Communication/GlobalCom.typ
Normal file
@@ -0,0 +1,36 @@
|
||||
(*//Standard Interface ABB Roboter*)
|
||||
|
||||
TYPE
|
||||
gtyp_ABBInterfaceIn : STRUCT (*Inputs from ABB Robot Interface*)
|
||||
bMotorsOn : BOOL := FALSE; (*00 Motors are On (Flash = Unsync)*)
|
||||
bMotorsOff : BOOL := FALSE; (*01 Motoren sind Aus (Blinken = Safety Chain)*)
|
||||
bProgramRun : BOOL := FALSE; (*02 Programm l<>uft*)
|
||||
bEStop : BOOL := FALSE; (*03 E-Stop von Roboter*)
|
||||
bAutomatic : BOOL := FALSE; (*04 Automatik Modus*)
|
||||
bError : BOOL := FALSE; (*05 Error von Roboter*)
|
||||
bRunChainOk : BOOL; (*06 RunChain Ok*)
|
||||
bLifebeat : BOOL := FALSE; (*07 Lifebeat von Roboter (<28>ber CC zur<75>ckgeroutet)*)
|
||||
bMotionSupervisionTriggered : BOOL := FALSE; (*08 Bewegungs<67>berwachung ausgl<67>st*)
|
||||
bWZHome : BOOL := FALSE; (*24 Roboter ist in Homepos*)
|
||||
bWZChangetool : BOOL := FALSE; (*25 Roboter ist in Weltzone ChangeTool*)
|
||||
bWZPlacepoint : BOOL := FALSE; (*26 Roboter ist in Weltzone Abgabepos <20>bergabestation*)
|
||||
usStatus : USINT := 0; (*64 Status*)
|
||||
END_STRUCT;
|
||||
gtyp_ABBInterfaceOut : STRUCT (*Output to ABB Robot Interface*)
|
||||
bSwitchMotorOn : BOOL := FALSE; (*00 Switch Motors On*)
|
||||
bSwitchMotorOff : BOOL := FALSE; (*01 Switch Motors Off*)
|
||||
bStart : BOOL := FALSE; (*02 Start - Nicht at Main*)
|
||||
bStop : BOOL := FALSE; (*03 Stop Cycle*)
|
||||
bResetEStop : BOOL := FALSE; (*04 Reset E-Stop*)
|
||||
bResetError : BOOL := FALSE; (*05 Reset Errors*)
|
||||
bStartAtMain : BOOL := FALSE; (*06 Start At Main (Continuous)*)
|
||||
bLifebeat : BOOL := FALSE; (*07 Lifebeat an Roboter*)
|
||||
bStartBackup : BOOL := FALSE; (*08 Start Backup*)
|
||||
usProgNr : USINT := 0; (*64 Programm Number*)
|
||||
END_STRUCT;
|
||||
gtyp_ABBInterface : STRUCT (*ABB Robot Interface*)
|
||||
bOnline : BOOL; (*Kommuniktion OK*)
|
||||
In : gtyp_ABBInterfaceIn; (*Eing<6E>nge von ABB Roboter*)
|
||||
Out : gtyp_ABBInterfaceOut; (*Ausga<67>nge an aBB Roboter*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
5
Logical/Communication/GlobalCom.var
Normal file
5
Logical/Communication/GlobalCom.var
Normal file
@@ -0,0 +1,5 @@
|
||||
(*//Kommunikationsstrukturen*)
|
||||
VAR RETAIN
|
||||
gABBRobot1 : gtyp_ABBInterface; (*Standard interface zu ABB Roboter*)
|
||||
END_VAR
|
||||
(*Variablen / Strukturen*)
|
||||
94
Logical/Communication/Keyence/Keyence/Action.st
Normal file
94
Logical/Communication/Keyence/Keyence/Action.st
Normal file
@@ -0,0 +1,94 @@
|
||||
|
||||
ACTION DoInitMachparameter:
|
||||
//Standard Maschinenparameter Laden
|
||||
//MpAuditCustomEvent (gMpAuditTrail, "Flexfeeder", "", "DefaultParameter");
|
||||
Parameter.sCam_IP := '192.168.1.186';
|
||||
END_ACTION
|
||||
|
||||
|
||||
ACTION DoTimes:
|
||||
//Zeiten berechnen
|
||||
Times.diSteptimeTCP := gdiSystemTime - TimesLatch.diSteptimeTCP;
|
||||
Times.diSteptimeFF := gdiSystemTime - TimesLatch.diSteptimeFF;
|
||||
END_ACTION
|
||||
|
||||
ACTION DoFubs:
|
||||
//Funktionsbausteine aufrufen
|
||||
//===================================================
|
||||
|
||||
//Enables reset
|
||||
IF enStepTCP <> enTCP_Step_Open THEN
|
||||
FUBs.TCP_Open.enable := FALSE;
|
||||
END_IF
|
||||
IF enStepTCP <> enTCP_Step_Connect THEN
|
||||
FUBs.TCP_Client.enable := FALSE;
|
||||
END_IF
|
||||
IF enStepTCP <> enTCP_Step_Connected THEN
|
||||
FUBs.TCP_Send.enable := FALSE;
|
||||
FUBs.TCP_Receive.enable := FALSE;
|
||||
END_IF
|
||||
IF enStepTCP <> enTCP_Step_Close THEN
|
||||
FUBs.TCP_CLose.enable := FALSE;
|
||||
END_IF
|
||||
|
||||
FUBs.TCP_Open ();
|
||||
FUBs.TCP_Client ();
|
||||
FUBs.TCP_CLose ();
|
||||
FUBs.TCP_Send ();
|
||||
FUBs.TCP_Receive ();
|
||||
END_ACTION
|
||||
|
||||
ACTION DoResetComAlarms:
|
||||
//Kommunikations Alarme r<EFBFBD>cksetzen
|
||||
//===================================================
|
||||
Alarms.bFFCamUnrecognizedCmd := FALSE;
|
||||
Alarms.bFFCamFilenameMissing := FALSE;
|
||||
Alarms.bFFCamLoadJobFailed := FALSE;
|
||||
Alarms.bFFCamOfflineManual := FALSE;
|
||||
END_ACTION
|
||||
|
||||
|
||||
ACTION DoAlarms:
|
||||
//Alarme erzeugen bzw. r<EFBFBD>cksetzen
|
||||
//===================================================
|
||||
//Unbekannter Befehl
|
||||
IF Alarms.bFFCamUnrecognizedCmd THEN
|
||||
IF (AlarmIDs.udFFCamUnrecognizedCmd = 0) THEN
|
||||
AlarmIDs.udFFCamUnrecognizedCmd := MpAlarmXSet (gMpAlarmXCore, 'CamUnrecognizedCmd');
|
||||
END_IF
|
||||
ELSIF (AlarmIDs.udFFCamUnrecognizedCmd > 0) THEN
|
||||
MpAlarmXResetID (gMpAlarmXCore, AlarmIDs.udFFCamUnrecognizedCmd);
|
||||
AlarmIDs.udFFCamUnrecognizedCmd := 0;
|
||||
END_IF
|
||||
|
||||
//Laden Dateiname fehlt
|
||||
IF Alarms.bFFCamFilenameMissing THEN
|
||||
IF (AlarmIDs.udFFCamFilenameMissing = 0) THEN
|
||||
AlarmIDs.udFFCamFilenameMissing := MpAlarmXSet (gMpAlarmXCore, 'CamFilenameMissing');
|
||||
END_IF
|
||||
ELSIF (AlarmIDs.udFFCamFilenameMissing > 0) THEN
|
||||
MpAlarmXResetID (gMpAlarmXCore, AlarmIDs.udFFCamFilenameMissing);
|
||||
AlarmIDs.udFFCamFilenameMissing := 0;
|
||||
END_IF
|
||||
|
||||
//Laden Fehlgeschlagen
|
||||
IF Alarms.bFFCamLoadJobFailed THEN
|
||||
IF (AlarmIDs.udFFCamLoadJobFailed = 0) THEN
|
||||
AlarmIDs.udFFCamLoadJobFailed := MpAlarmXSet (gMpAlarmXCore, 'CamLoadJobFailed');
|
||||
END_IF
|
||||
ELSIF (AlarmIDs.udFFCamLoadJobFailed > 0) THEN
|
||||
MpAlarmXResetID (gMpAlarmXCore, AlarmIDs.udFFCamLoadJobFailed);
|
||||
AlarmIDs.udFFCamLoadJobFailed := 0;
|
||||
END_IF
|
||||
|
||||
//Kamera ist Offline
|
||||
IF Alarms.bFFCamOfflineManual THEN
|
||||
IF (AlarmIDs.udFFCamOfflineManual = 0) THEN
|
||||
AlarmIDs.udFFCamOfflineManual := MpAlarmXSet (gMpAlarmXCore, 'CamOfflineManual');
|
||||
END_IF
|
||||
ELSIF (AlarmIDs.udFFCamOfflineManual > 0) THEN
|
||||
MpAlarmXResetID (gMpAlarmXCore, AlarmIDs.udFFCamOfflineManual);
|
||||
AlarmIDs.udFFCamOfflineManual := 0;
|
||||
END_IF
|
||||
|
||||
END_ACTION
|
||||
11
Logical/Communication/Keyence/Keyence/IEC.prg
Normal file
11
Logical/Communication/Keyence/Keyence/IEC.prg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.7.5.60 SP?>
|
||||
<Program SubType="IEC" xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Aktionen TBrk-Ctrl">Action.st</File>
|
||||
<File Description="Implementation code">KeyenceInit.st</File>
|
||||
<File Description="Implementation code">KeyenceCyclic.st</File>
|
||||
<File Description="Local variables" Private="true">Keyence.var</File>
|
||||
<File Description="Local data types" Private="true">Types.typ</File>
|
||||
</Files>
|
||||
</Program>
|
||||
35
Logical/Communication/Keyence/Keyence/Keyence.var
Normal file
35
Logical/Communication/Keyence/Keyence/Keyence.var
Normal file
@@ -0,0 +1,35 @@
|
||||
(*//Dynamische Variablen*)
|
||||
(*//Lokale Variablen*)
|
||||
VAR
|
||||
bTemp : BOOL;
|
||||
sRecv : STRING[80];
|
||||
sRecvCopy : STRING[80];
|
||||
sSend : {REDUND_UNREPLICABLE} STRING[80];
|
||||
sTemp : STRING[3];
|
||||
sDebug1 : {REDUND_UNREPLICABLE} STRING[80];
|
||||
sDebug2 : {REDUND_UNREPLICABLE} STRING[80];
|
||||
END_VAR
|
||||
(*//Processed Communication Structure*)
|
||||
(*//Strukturen*)
|
||||
VAR RETAIN
|
||||
enStepTCP : typ_enTCP; (*Schrittkette*)
|
||||
enStepCam : typ_enCam; (*Schrittkette*)
|
||||
Status : typ_States; (*Statis*)
|
||||
END_VAR
|
||||
VAR
|
||||
Alarms : typ_Alarms;
|
||||
AlarmIDs : typ_AlarmIDs; (*Alarm IDs*)
|
||||
Times : typ_Times;
|
||||
TimesLatch : typ_Times; (*Gespeicherte Systemzeit*)
|
||||
END_VAR
|
||||
VAR RETAIN
|
||||
Parameter : {REDUND_UNREPLICABLE} typ_Parameter; (*Parameter*)
|
||||
END_VAR
|
||||
(*//Funktionsbl<62>cke*)
|
||||
VAR
|
||||
FUBs : typ_FUB; (*Funktionsbausteine*)
|
||||
END_VAR
|
||||
(*//VC*)
|
||||
VAR
|
||||
VCButtons : typ_VCButtons; (*VC - Buttons*)
|
||||
END_VAR
|
||||
403
Logical/Communication/Keyence/Keyence/KeyenceCyclic.st
Normal file
403
Logical/Communication/Keyence/Keyence/KeyenceCyclic.st
Normal file
@@ -0,0 +1,403 @@
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
|
||||
//Standardparametersatz laden
|
||||
//==================================================
|
||||
VCButtons.DefaultParameter.usStatus.0 := (gUserRights.Right3_Parameter < mpUSERX_ACCESS_FULL);
|
||||
VCButtons.DefaultParameter.usStatus.1 := (gUserRights.Right3_Parameter < mpUSERX_ACCESS_FULL);
|
||||
IF EDGEPOS (VCButtons.DefaultParameter.bCommand) THEN
|
||||
DoInitMachparameter;
|
||||
END_IF
|
||||
|
||||
VCButtons.ResetCommunications.usStatus.0 := (enStepTCP = enTCP_Step_Close);
|
||||
//Verbindung wiederherstellen
|
||||
IF EDGEPOS (VCButtons.ResetCommunications.bCommand) THEN
|
||||
enStepTCP := enTCP_Step_Close;
|
||||
VCButtons.ResetCommunications.bCommand := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Zeiten berechnen
|
||||
DoTimes;
|
||||
|
||||
//TCP Schnittstelle
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
CASE enStepTCP OF
|
||||
//Socket <EFBFBD>ffnen
|
||||
//---------------------------
|
||||
enTCP_Step_Open:
|
||||
FUBs.TCP_Open.options := tcpOPT_REUSEADDR;
|
||||
FUBs.TCP_Open.pIfAddr := 0; //Optional ADR (str_PLC_IPAdress)
|
||||
FUBs.TCP_Open.port := 0; //Freie Portwahl
|
||||
FUBs.TCP_Open.enable := NOT Status.bDisableConnReq;
|
||||
|
||||
IF FUBs.TCP_Open.status = tcpERR_NOMORE_IDENTS THEN
|
||||
//keine Freien Idents mehr
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Open.status = tcpERR_ALREADY_EXIST THEN
|
||||
//Socket bereits ge<EFBFBD>ffnet weiter werwenden
|
||||
Status.udSocket := FUBs.TCP_Open.ident;
|
||||
enStepTCP := enTCP_Step_Connect;
|
||||
ELSIF FUBs.TCP_Open.status = tcpERR_SOCKET_CREATE THEN
|
||||
//Socket konnte nicht erstellt werden
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Open.status = tcpERR_SOCKET_BIND THEN
|
||||
//Binderror
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Open.status = tcpERR_INTERFACE THEN
|
||||
//Interfacefehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Open.status = tcpERR_SYSTEM THEN
|
||||
//Systemfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Open.status = ERR_OK THEN
|
||||
Status.udSocket := FUBs.TCP_Open.ident;
|
||||
enStepTCP := enTCP_Step_Connect;
|
||||
END_IF
|
||||
|
||||
//Verbindung aufbauen
|
||||
//---------------------------
|
||||
enTCP_Step_Connect:
|
||||
FUBs.TCP_Client.ident := Status.udSocket;
|
||||
FUBs.TCP_Client.portserv := 8500;
|
||||
FUBs.TCP_Client.pServer := ADR (Parameter.sCam_IP);
|
||||
FUBs.TCP_Client.enable := TRUE;
|
||||
|
||||
IF FUBs.TCP_Client.status = tcpERR_INVALID_IDENT THEN
|
||||
//Un<EFBFBD>ltiger Ident
|
||||
enStepTCP := enTCP_Step_Open;
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Client.status = tcpERR_PARAMETER THEN
|
||||
//Falsche Parameter
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Client.status = tcpERR_INVALID THEN
|
||||
//Socket ung<EFBFBD>ltig muss getrennt werden
|
||||
enStepTCP := enTCP_Step_Close;
|
||||
ELSIF FUBs.TCP_Client.status = tcpERR_ALREADY_CONNECTED THEN
|
||||
//Verbindung bereits vorhanden schlie<EFBFBD>en
|
||||
enStepTCP := enTCP_Step_Close;
|
||||
ELSIF FUBs.TCP_Client.status = tcpERR_SYSTEM THEN
|
||||
//Systemfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Client.status = ERR_OK THEN
|
||||
//verbunden
|
||||
enStepTCP := enTCP_Step_Connected;
|
||||
END_IF
|
||||
|
||||
//Verbunden
|
||||
//---------------------------
|
||||
enTCP_Step_Connected:
|
||||
//Empfang ausf<EFBFBD>hren
|
||||
FUBs.TCP_Receive.ident := Status.udSocket;
|
||||
FUBs.TCP_Receive.pData := ADR (sRecv);
|
||||
FUBs.TCP_Receive.datamax := SIZEOF (sRecv);
|
||||
FUBs.TCP_Receive.enable := TRUE;
|
||||
|
||||
IF FUBs.TCP_Receive.status = tcpERR_INVALID_IDENT THEN
|
||||
//Un<EFBFBD>ltiger Ident
|
||||
enStepTCP := enTCP_Step_Open;
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_PARAMETER THEN
|
||||
//Parameterfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_NO_DATA THEN
|
||||
//Keine Daten sp<EFBFBD>ter wiederholen
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_INVALID THEN
|
||||
//Ung<EFBFBD>ltiges Argument
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_NOT_CONNECTED THEN
|
||||
//Verbindung beendet durch Gegenstelle Socket schlie<EFBFBD>en und Verb. neu aufbuen
|
||||
enStepTCP := enTCP_Step_Close;
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_NO_OOBDATA THEN
|
||||
//eine OOB-Daten vorhanden. Applikationsabh<EFBFBD>ngig. Flag tcpMSG_OOB nicht setzen.
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = tcpERR_SYSTEM THEN
|
||||
//Systemfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Receive.status = ERR_OK THEN
|
||||
//Daten erhalten
|
||||
IF Status.bSendData THEN
|
||||
//fixme
|
||||
END_IF
|
||||
IF Status.bDataReceived THEN
|
||||
//FixMe
|
||||
END_IF
|
||||
Status.bDataReceived := TRUE;
|
||||
sRecvCopy := sRecv;
|
||||
//FixMe Error
|
||||
END_IF
|
||||
|
||||
FUBs.TCP_Send.ident := Status.udSocket;
|
||||
FUBs.TCP_Send.pData := ADR (sSend);
|
||||
FUBs.TCP_Send.datalen := brsstrlen (ADR (sSend));
|
||||
FUBs.TCP_Send.enable := Status.bSendData;
|
||||
|
||||
|
||||
IF FUBs.TCP_Send.status = tcpERR_INVALID_IDENT THEN
|
||||
//Un<EFBFBD>ltiger Ident
|
||||
enStepTCP := enTCP_Step_Open;
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = tcpERR_PARAMETER THEN
|
||||
//Parameterfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = tcpERR_SENTLEN THEN
|
||||
//Die <EFBFBD>bernommene Datenl<EFBFBD>nge entspricht nicht der angegebenen Datenl<EFBFBD>nge. <EFBFBD>brige Daten nochmals senden.
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = tcpERR_WOULDBLOCK THEN
|
||||
//Daten konnten nicht in den Sendepuffer des Sockets <EFBFBD>bernommen werden. Vorgang sp<EFBFBD>ter wiederholen.
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = tcpERR_NOT_CONNECTED THEN
|
||||
//Verbindung beendet durch Gegenstelle Socket schlie<EFBFBD>en und Verb. neu aufbuen
|
||||
enStepTCP := enTCP_Step_Close;
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = tcpERR_SYSTEM THEN
|
||||
//Systemfehler
|
||||
//FixMe Error
|
||||
ELSIF FUBs.TCP_Send.status = ERR_OK THEN
|
||||
//Daten gesendet
|
||||
Status.bSendData := FALSE;
|
||||
Status.bDataSent := TRUE;
|
||||
//FixMe Error
|
||||
END_IF
|
||||
|
||||
//Trennen
|
||||
//---------------------------
|
||||
enTCP_Step_Close:
|
||||
FUBs.TCP_CLose.ident := Status.udSocket;
|
||||
FUBs.TCP_CLose.enable := TRUE;
|
||||
|
||||
IF FUBs.TCP_CLose.status = ERR_OK THEN
|
||||
Status.bDisableConnReq := FALSE;
|
||||
enStepTCP := enTCP_Step_Open;
|
||||
enStepCam := enCamStep_Offline;
|
||||
END_IF
|
||||
|
||||
END_CASE
|
||||
|
||||
|
||||
|
||||
//Cam Schrittkette
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
CASE enStepCam OF
|
||||
//Offline warten auf Userprompt
|
||||
//-----------------------------
|
||||
enCamStep_Offline:
|
||||
IF enStepTCP = enTCP_Step_Connected THEN
|
||||
enStepCam := enCamStep_Idle;
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
END_IF
|
||||
|
||||
//Auf Ergebnis warten
|
||||
//-----------------------------
|
||||
enCamStep_Idle:
|
||||
IF gCmd1.Cam.FromRobot.bTriggerCamHole AND (gCmd1.usPartVariant = 1) THEN
|
||||
//G80 Loch
|
||||
Status.sNextPrg := '001';
|
||||
enStepCam := enCamStep_LoadPrgNr;
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
gbOuDarkfieldLight := FALSE;
|
||||
ELSIF gCmd1.Cam.FromRobot.bTriggerCamID AND (gCmd1.usPartVariant = 1) THEN
|
||||
//G80 ID
|
||||
Status.sNextPrg := '002';
|
||||
enStepCam := enCamStep_LoadPrgNr;
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
gbOuDarkfieldLight := TRUE;
|
||||
ELSIF gCmd1.Cam.FromRobot.bTriggerCamHole AND (gCmd1.usPartVariant = 0) THEN
|
||||
//G82 Loch
|
||||
Status.sNextPrg := '003';
|
||||
enStepCam := enCamStep_LoadPrgNr;
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
gbOuDarkfieldLight := FALSE;
|
||||
ELSIF gCmd1.Cam.FromRobot.bTriggerCamID AND (gCmd1.usPartVariant = 0) THEN
|
||||
//G82 ID
|
||||
Status.sNextPrg := '004';
|
||||
enStepCam := enCamStep_LoadPrgNr;
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
gbOuDarkfieldLight := TRUE;
|
||||
END_IF
|
||||
|
||||
//Programmnummer auslesen
|
||||
//-----------------------------
|
||||
enCamStep_ReadPrgNr:
|
||||
//User Senden
|
||||
sSend := 'PR';
|
||||
brsstrcat (ADR (sSend), ADR ('$r'));
|
||||
Status.bSendData := NOT Status.bDataSent AND (Times.diSteptimeFF > 500000);
|
||||
|
||||
IF Status.bDataReceived THEN
|
||||
IF brsmemcmp (ADR ('PR,'), ADR (sRecv), 3) = 0 THEN
|
||||
//Programm nummer gelesen - Ok
|
||||
brsmemset (ADR (sTemp), 0, SIZEOF (sTemp));
|
||||
brsmemcpy (ADR (Status.sCurPrg), ADR (sRecv) + 3, 3);
|
||||
Status.bDataSent := FALSE;
|
||||
TimesLatch.diSteptimeFF := gdiSystemTime;
|
||||
enStepCam := enCamStep_Idle;
|
||||
ELSE
|
||||
//Fixme
|
||||
END_IF
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
ELSIF (Times.diSteptimeFF > 4000000) THEN
|
||||
//Wiederholen
|
||||
Status.bDataSent := FALSE;
|
||||
TimesLatch.diSteptimeFF := gdiSystemTime;
|
||||
END_IF
|
||||
|
||||
|
||||
|
||||
//Job laden
|
||||
//-----------------------------
|
||||
enCamStep_LoadPrgNr:
|
||||
sSend := 'PW,';
|
||||
brsstrcat (ADR (sSend), ADR (Status.sNextPrg));
|
||||
brsstrcat (ADR (sSend), ADR ('$r$n'));
|
||||
Status.bSendData := NOT Status.bDataSent;
|
||||
|
||||
IF Status.bDataReceived THEN
|
||||
IF brsmemcmp (ADR ('PW'), ADR (sRecv), 2) = 0 THEN
|
||||
//Befehl Ok
|
||||
DoResetComAlarms;
|
||||
Status.bDataSent := FALSE;
|
||||
TimesLatch.diSteptimeFF := gdiSystemTime;
|
||||
IF brsstrcmp (ADR (Status.sNextPrg), ADR ('001')) = 0 THEN
|
||||
//Programm 1 Loecher
|
||||
enStepCam := enCamStep_Trigger;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('002')) = 0 THEN
|
||||
//Programm 2 Charge
|
||||
enStepCam := enCamStep_SetLotNr;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('003')) = 0 THEN
|
||||
//Programm 3 Loecher
|
||||
enStepCam := enCamStep_Trigger;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('004')) = 0 THEN
|
||||
//Programm 4 Charge
|
||||
enStepCam := enCamStep_SetLotNr;
|
||||
END_IF
|
||||
ELSIF brsmemcmp (ADR ('ER,PW'), ADR (sRecv), 5) = 0 THEN
|
||||
//Fehler Programmwechsel
|
||||
Alarms.bFFCamUnrecognizedCmd := TRUE;
|
||||
Status.bDataSent := FALSE;
|
||||
ELSE
|
||||
//Fixme
|
||||
END_IF
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Chargennummer <EFBFBD>bergeben - Werkzeug 01
|
||||
//-----------------------------
|
||||
enCamStep_SetLotNr:
|
||||
sSend := 'CW,01,';
|
||||
//Job aus Parametersatz laden
|
||||
brsstrcat (ADR (sSend), ADR (Status.sLotNr));
|
||||
brsstrcat (ADR (sSend), ADR ('$r$n'));
|
||||
Status.bSendData := NOT Status.bDataSent;
|
||||
|
||||
IF Status.bDataReceived THEN
|
||||
IF brsmemcmp (ADR ('CW,01'), ADR (sRecv), 3) = 0 THEN
|
||||
//Befehl Ok
|
||||
Status.bDataSent := FALSE;
|
||||
DoResetComAlarms;
|
||||
TimesLatch.diSteptimeFF := gdiSystemTime;
|
||||
enStepCam := enCamStep_Trigger;
|
||||
ELSIF brsmemcmp (ADR ('ER,CW'), ADR (sRecv), 5) = 0 THEN
|
||||
//Fehler Programmwechsel
|
||||
Alarms.bFFCamUnrecognizedCmd := TRUE;
|
||||
Status.bDataSent := FALSE;
|
||||
ELSE
|
||||
//Fixme
|
||||
END_IF
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
END_IF
|
||||
|
||||
//Triggern
|
||||
//-----------------------------
|
||||
enCamStep_Trigger:
|
||||
sSend := 'T2';
|
||||
//Job aus Parametersatz laden
|
||||
brsstrcat (ADR (sSend), ADR ('$r$n'));
|
||||
Status.bSendData := NOT Status.bDataSent;
|
||||
|
||||
IF Status.bDataReceived THEN
|
||||
IF brsmemcmp (ADR ('RT,'), ADR (sRecv), 3) = 0 THEN
|
||||
//Befehl Ok
|
||||
//aaaaa,bb
|
||||
//RT,02633,NG,00,NG,0000039,01,--,0000000,02,--,0000000$r'
|
||||
//RT,03578,OK,01,OK,0000092$r'
|
||||
bTemp := (brsmemcmp (ADR ('OK'), ADR (sRecv) + 9, 2) = 0);
|
||||
IF brsstrcmp (ADR (Status.sNextPrg), ADR ('001')) = 0 THEN
|
||||
//Programm 1 Loecher
|
||||
gCmd1.Cam.ToRobot.bPartOk := bTemp;
|
||||
gCmd1.Cam.ToRobot.bPartNoK := NOT bTemp;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('002')) = 0 THEN
|
||||
//Programm 2 Charge
|
||||
gCmd1.Cam.ToRobot.bIDOk := bTemp;
|
||||
gCmd1.Cam.ToRobot.bIDNoK := NOT bTemp;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('003')) = 0 THEN
|
||||
//Programm 3 Loecher
|
||||
gCmd1.Cam.ToRobot.bPartOk := bTemp;
|
||||
gCmd1.Cam.ToRobot.bPartNoK := NOT bTemp;
|
||||
ELSIF brsstrcmp (ADR (Status.sNextPrg), ADR ('004')) = 0 THEN
|
||||
//Programm 4 Charge
|
||||
gCmd1.Cam.ToRobot.bIDOk := bTemp;
|
||||
gCmd1.Cam.ToRobot.bIDNoK := NOT bTemp;
|
||||
END_IF
|
||||
Status.bDataSent := FALSE;
|
||||
DoResetComAlarms;
|
||||
TimesLatch.diSteptimeFF := gdiSystemTime;
|
||||
enStepCam := enCamStep_Handshake;
|
||||
ELSIF brsmemcmp (ADR ('ER,CW'), ADR (sRecv), 5) = 0 THEN
|
||||
//Fehler Programmwechsel
|
||||
Alarms.bFFCamUnrecognizedCmd := TRUE;
|
||||
Status.bDataSent := FALSE;
|
||||
ELSE
|
||||
//Fixme
|
||||
END_IF
|
||||
brsmemset (ADR (sRecv), 0, brsstrlen (ADR (sRecv)));
|
||||
Status.bDataReceived := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Handshake
|
||||
//-----------------------------
|
||||
enCamStep_Handshake:
|
||||
IF NOT gCmd1.Cam.FromRobot.bTriggerCamHole AND NOT gCmd1.Cam.FromRobot.bTriggerCamID THEN
|
||||
gCmd1.Cam.ToRobot.bPartOk := FALSE;
|
||||
gCmd1.Cam.ToRobot.bPartNoK := FALSE;
|
||||
gCmd1.Cam.ToRobot.bIDOk := FALSE;
|
||||
gCmd1.Cam.ToRobot.bIDNoK := FALSE;
|
||||
enStepCam := enCamStep_Idle;
|
||||
gbOuDarkfieldLight := FALSE;
|
||||
END_IF
|
||||
|
||||
END_CASE
|
||||
|
||||
|
||||
IF NOT gCmd1.Cam.FromRobot.bTriggerCamHole AND NOT gCmd1.Cam.FromRobot.bTriggerCamID THEN
|
||||
gCmd1.Cam.ToRobot.bIDNoK := FALSE;
|
||||
gCmd1.Cam.ToRobot.bIDOk := FALSE;
|
||||
gCmd1.Cam.ToRobot.bPartNoK := FALSE;
|
||||
gCmd1.Cam.ToRobot.bPartOk := FALSE;
|
||||
END_IF
|
||||
|
||||
//gCmd1.Cam.FromCam.bCamOnline := ( enStepCam = enCamStep_IsOnline);
|
||||
|
||||
IF NOT gMachine1.bMachineON THEN
|
||||
gbOuDarkfieldLight := FALSE;
|
||||
END_IF
|
||||
|
||||
//FuBs aufrufen
|
||||
DoFubs;
|
||||
|
||||
//Alarme
|
||||
DoAlarms;
|
||||
|
||||
END_PROGRAM
|
||||
6
Logical/Communication/Keyence/Keyence/KeyenceInit.st
Normal file
6
Logical/Communication/Keyence/Keyence/KeyenceInit.st
Normal file
@@ -0,0 +1,6 @@
|
||||
PROGRAM _INIT
|
||||
Status.bDataSent := FALSE;
|
||||
enStepCam := enCamStep_Offline;
|
||||
enStepTCP := enTCP_Step_Open;
|
||||
|
||||
END_PROGRAM
|
||||
80
Logical/Communication/Keyence/Keyence/Types.typ
Normal file
80
Logical/Communication/Keyence/Keyence/Types.typ
Normal file
@@ -0,0 +1,80 @@
|
||||
(*//I/Os*)
|
||||
(*//Strukturen*)
|
||||
|
||||
TYPE
|
||||
typ_States : STRUCT
|
||||
bDisableConnReq : BOOL; (*Verbindungsaufbau unterbrechen*)
|
||||
bDataReceived : BOOL; (*Daten erhalten*)
|
||||
bSendData : BOOL; (*Daten senden*)
|
||||
bDataSent : BOOL; (*Daten gesendet*)
|
||||
udSocket : UDINT; (*Socket Handle*)
|
||||
sCurPrg : STRING[3]; (*Aktuelles Prorgramm*)
|
||||
sNextPrg : STRING[3]; (*Naechstes Prorgramm*)
|
||||
sLotNr : STRING[4]; (*Chargennummer*)
|
||||
END_STRUCT;
|
||||
typ_Times : STRUCT (*Zykluszeiten etc.*)
|
||||
diSteptimeTCP : {REDUND_UNREPLICABLE} DINT; (*[<5B>s]*)
|
||||
diSteptimeFF : {REDUND_UNREPLICABLE} DINT; (*[<5B>s]*)
|
||||
END_STRUCT;
|
||||
typ_Parameter : STRUCT (*Parameter (Feste Parameter Schrauber bezogen)*)
|
||||
sCam_IP : STRING[15] := '192.168.1.86'; (*Kamera IP-Adresse*)
|
||||
END_STRUCT;
|
||||
typ_FUB : STRUCT
|
||||
TCP_Open : TcpOpen; (*Socket <20>ffnen*)
|
||||
TCP_Client : TcpClient; (*Verbindung aufbauen*)
|
||||
TCP_CLose : TcpClose; (*Verbindung schlie<69>en*)
|
||||
TCP_Send : TcpSend; (*Senden*)
|
||||
TCP_Receive : TcpRecv; (*Empfangen*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
(*//Schrittketten / Befehle / Bedingungen*)
|
||||
|
||||
TYPE
|
||||
typ_enTCP :
|
||||
( (*Schrittkette*)
|
||||
enTCP_Step_Open := 0, (*Socket <20>ffnen*)
|
||||
enTCP_Step_Connect, (*Client verbindung aufbauen*)
|
||||
enTCP_Step_Connected, (*Verbunden / Senden / Empfangen*)
|
||||
enTCP_Step_Close (*Verbindung schlie<69>en*)
|
||||
);
|
||||
typ_enCam :
|
||||
(
|
||||
enCamStep_Offline, (*Flexfeeder Offline - Warte auf User Prompt - Username Senden*)
|
||||
enCamStep_Idle,
|
||||
enCamStep_ReadPrgNr, (*Programmnummer lesen*)
|
||||
enCamStep_LoadPrgNr, (*Programm laden*)
|
||||
enCamStep_SetLotNr, (*Chargenummer setzen*)
|
||||
enCamStep_Trigger, (*Aufnahme triggern und auf Status warten*)
|
||||
enCamStep_Handshake
|
||||
);
|
||||
END_TYPE
|
||||
|
||||
(*//Alarme*)
|
||||
|
||||
TYPE
|
||||
typ_Alarms : STRUCT (*Alarme*)
|
||||
bFFCamUnrecognizedCmd : BOOL; (*Unbekannter Befehl*)
|
||||
bFFCamFilenameMissing : BOOL; (*Laden Dateinahme Fehlt*)
|
||||
bFFCamLoadJobFailed : BOOL; (*Laden fehlgeschlagen / System Online / Datei nicht gefunden*)
|
||||
bFFCamOfflineManual : BOOL; (*Kamera <20>ber Insight Explorer Offline*)
|
||||
END_STRUCT;
|
||||
typ_AlarmIDs : STRUCT (*Puffer f<>r Alarm IDs*)
|
||||
udFFCamUnrecognizedCmd : UDINT; (*Unbekannter Befehl*)
|
||||
udFFCamFilenameMissing : UDINT; (*Laden Dateinahme Fehlt*)
|
||||
udFFCamLoadJobFailed : UDINT; (*Laden fehlgeschlagen / System Online / Datei nicht gefunden*)
|
||||
udFFCamOfflineManual : UDINT; (*Kamera <20>ber Insight Explorer Offline*)
|
||||
END_STRUCT;
|
||||
typ_AlarmSnippets : STRUCT (*Infos f<>r Alarmtexte*)
|
||||
strDummy : STRING[40]; (*Dummystring*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
(*//Visual Components*)
|
||||
|
||||
TYPE
|
||||
typ_VCButtons : STRUCT (*Visual Controls Buttons*)
|
||||
DefaultParameter : gtyp_VCButton; (*Default Parameter Laden*)
|
||||
ResetCommunications : gtyp_VCButton; (*Verbindung abbrechen*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
8
Logical/Communication/Keyence/Package.pkg
Normal file
8
Logical/Communication/Keyence/Package.pkg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.7.5.60 SP?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="Program" Language="IEC" Description="Kommunikation mit EGP Greifer">Keyence</Object>
|
||||
<Object Type="File" Description="Alarme">TxtAlarms.tmx</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
41
Logical/Communication/Keyence/TxtAlarms.tmx
Normal file
41
Logical/Communication/Keyence/TxtAlarms.tmx
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<tmx version="1.4">
|
||||
<header creationtool="B&R Automation Studio" creationtoolversion="4.2" datatype="unknown" segtype="sentence" adminlang="en" srclang="en" o-tmf="TMX">
|
||||
<note>Change the namespace to define where this text module should be located within the logical structure of your texts</note>
|
||||
<prop type="x-BR-TS:Namespace">Cognex/Alarms</prop>
|
||||
</header>
|
||||
<body>
|
||||
<tu tuid="CamUnrecognizedCmd">
|
||||
<tuv xml:lang="de">
|
||||
<seg>Messung: Kamera Unbekannter Befehl</seg>
|
||||
</tuv>
|
||||
<tuv xml:lang="en">
|
||||
<seg>Measurement: Cam Unrecognized Command</seg>
|
||||
</tuv>
|
||||
</tu>
|
||||
<tu tuid="CamFilenameMissing">
|
||||
<tuv xml:lang="de">
|
||||
<seg>Messung: Kamera Job laden - Dateiname fehlt</seg>
|
||||
</tuv>
|
||||
<tuv xml:lang="en">
|
||||
<seg>Measurement: Cam Load Job - Filename missing</seg>
|
||||
</tuv>
|
||||
</tu>
|
||||
<tu tuid="CamLoadJobFailed">
|
||||
<tuv xml:lang="de">
|
||||
<seg>Messung: Kamera Job laden fehlgeschlagen (Cam Online / Datei fehlt)</seg>
|
||||
</tuv>
|
||||
<tuv xml:lang="en">
|
||||
<seg>Measurement: Cam Load Job failed (System Online / File missing)</seg>
|
||||
</tuv>
|
||||
</tu>
|
||||
<tu tuid="CamOfflineManual">
|
||||
<tuv xml:lang="de">
|
||||
<seg>Messung: Kamera Offline durch Insight Explorer</seg>
|
||||
</tuv>
|
||||
<tuv xml:lang="en">
|
||||
<seg>Measurement: Cam Offline by Insight Explorer</seg>
|
||||
</tuv>
|
||||
</tu>
|
||||
</body>
|
||||
</tmx>
|
||||
10
Logical/Communication/Package.pkg
Normal file
10
Logical/Communication/Package.pkg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.7.5.60 SP?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="File" Description="Communication Types">GlobalCom.typ</Object>
|
||||
<Object Type="File" Description="Logging Vars">GlobalCom.var</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Communication to ABB Robot 1 (IRC 5 Version)">ABBCom</Object>
|
||||
<Object Type="Package" Description="Kommunikation mit Keyence Cam">Keyence</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
79
Logical/GlobalVars/Global.typ
Normal file
79
Logical/GlobalVars/Global.typ
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
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;
|
||||
PushButton_typ : 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;
|
||||
END_TYPE
|
||||
134
Logical/GlobalVars/Global.var
Normal file
134
Logical/GlobalVars/Global.var
Normal file
@@ -0,0 +1,134 @@
|
||||
(*================================================================================================================*)
|
||||
(*CPU (PWLnk Node 240)*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
udSerialNr : UDINT; (*Seriennummer*)
|
||||
giTemperatureCPU : INT; (*CPU Temperatur*)
|
||||
giTemperatureENV : INT; (*Umgebungstemperatur*)
|
||||
gdiSystemTime : DINT; (*Systemzeit [<5B>s]*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF6.ST2 - SLX410*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSLXModuleOk : BOOL;
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*Signals to Safe PLC*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSPLCResetEStop : BOOL; (*Reset Not-Halt*)
|
||||
gbSPLCResetDoors : BOOL; (*Reset T<>ren*)
|
||||
gbSPLCReadbackEstop : BOOL; (*R<>ckf<6B>hrkreis*)
|
||||
END_VAR
|
||||
(*R<>cklesesignale direkt von Eingang gemappt*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*Signals from Safe PLC*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSPLCInEstopOk : BOOL; (*Safety PLC E-Stop ist Ok*)
|
||||
gbSPLCInDoorsOk : BOOL; (*Safety PLC T<>rkreis it Ok*)
|
||||
gbSPLCInErrorReadBackEStop : BOOL; (*Safety PlC Fehler R<>ckf<6B>hrkreis Netzsch<63>tze (PV Mapping von DI)*)
|
||||
guiSPLCInESTOPDiag : UINT; (*DiagnoseCode E-Stop*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*I/O from SLX*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSInEStop1Ok : BOOL; (*Sicherer Eingang 1/2 Equivalent - Nothalt Bedientableau Ok*)
|
||||
gusST2FBK_2ChStatus12 : USINT; (*Status 2-kanal*)
|
||||
gusST2FBK_2ChStatus34 : USINT; (*Status 2-kanal*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF6.ST3 - SC2212*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSInEStopRobotOk : BOOL; (*Sicherer Eingang 3/4 Equivalent - Nothalt von Roboter Ok*)
|
||||
gbSInMaintDoor1Ok : BOOL; (*Sicherer Eingang 5/6 Equivalent - Schutztuer 1 Ok*)
|
||||
gbSOuMainValveAir : BOOL; (*Sicherer Ausgang 01 - Freigabe Luft*)
|
||||
gusST3FBK_2ChStatus12 : USINT; (*Status 2-kanal*)
|
||||
gusST3FBK_2ChStatus34 : USINT; (*Status 2-kanal*)
|
||||
gusST3FBK_2ChStatus56 : USINT; (*Status 2-kanal*)
|
||||
guiST3FBK_StatusRestInhibit : UINT; (*Status Wiederanlaufsperre*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF6.ST4 - SI4100*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSInMaintDoor2Ok : BOOL; (*Sicherer Eingang 1/2 Equivalent - Schutztuer 2 Ok*)
|
||||
gbSInMaintDoor3Ok : BOOL; (*Sicherer Eingang 3/4 Equivalent - Schutztuer 3 Ok*)
|
||||
gusST4FBK_2ChStatus12 : USINT; (*Status 2-kanal*)
|
||||
gusST4FBK_2ChStatus23 : USINT; (*Status 2-kanal*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF6.ST5 - SI4100*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSInMaintDoor4Ok : BOOL; (*Sicherer Eingang 1/2 Equivalent - Schutztuer 4 Ok*)
|
||||
gbSInMaintDoor5Ok : BOOL; (*Sicherer Eingang 3/4 Equivalent - Schutztuer 5 Ok*)
|
||||
gusST5FBK_2ChStatus12 : USINT; (*Status 2-kanal*)
|
||||
gusST5FBK_2ChStatus34 : USINT; (*Status 2-kanal*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST5 - SO6300*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gudST5FBK_StatusRestInhibit : UDINT; (*Status Wiederanlaufsperre*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST5 - SO6530*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbSOuSafetyOk : BOOL; (*Sicherer Ausgang 01/02 Sicherheit Ok*)
|
||||
gbSOuRobotEStop : BOOL; (*Sicherer Ausgang 03/04 Nothalt 2-kanalig an Roboter (General Stop / EStop)*)
|
||||
gbSOuRobotAStop : BOOL; (*Sicherer Ausgang 05/06 Auto-Stop 2-kanalig an Roboter*)
|
||||
END_VAR
|
||||
(*IF1.ST5 - DI9371 (Eing<6E>nge Allgemein)*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*//1Spare*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST6 - DI9371 (Eing<6E>nge Allgemein)*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST7 - DI9371 (Eing<6E>nge*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbInMaintDoor1Closed : BOOL; (*Wartungst<73>r 1 Geschlossen - nicht verriegelt*)
|
||||
gbInMaintDoor1Error : BOOL; (*Wartungst<73>r 1 Diagnose - Fehler*)
|
||||
gbInMaintDoor1Locked : BOOL; (*Wartungst<73>r 1 Verriegelt*)
|
||||
gbInMaintDoor2Closed : BOOL; (*Wartungst<73>r 2 Geschlossen - nicht verriegelt*)
|
||||
gbInMaintDoor2Error : BOOL; (*Wartungst<73>r 2 Diagnose - Fehler*)
|
||||
gbInMaintDoor2Locked : BOOL; (*Wartungst<73>r 2 Verriegelt*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST8 - DI9371 (Eing<6E>nge)*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbInMaintDoor3Closed : BOOL; (*Wartungst<73>r 3 Geschlossen - nicht verriegelt*)
|
||||
gbInMaintDoor3Error : BOOL; (*Wartungst<73>r 3 Diagnose - Fehler*)
|
||||
gbInMaintDoor3Locked : BOOL; (*Wartungst<73>r 3 Verriegelt*)
|
||||
gbInMaintDoor4Closed : BOOL; (*Wartungst<73>r 4 Geschlossen - nicht verriegelt*)
|
||||
gbInMaintDoor4Error : BOOL; (*Wartungst<73>r 4 Diagnose - Fehler*)
|
||||
gbInMaintDoor4Locked : BOOL; (*Wartungst<73>r 4 Verriegelt*)
|
||||
END_VAR
|
||||
(*/Spare*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST9 - DI9371 (Eing<6E>nge)*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST10 - X20DO9322*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
VAR
|
||||
gbOuMaintDoor1Lock : BOOL; (*Wartungst<73>r 1 Verriegeln*)
|
||||
gbOuMaintDoor2Lock : BOOL; (*Wartungst<73>r 2 Verriegeln*)
|
||||
gbOuMaintDoor3Lock : BOOL; (*Wartungst<73>r 3 Verriegeln*)
|
||||
gbOuMaintDoor4Lock : BOOL; (*Wartungst<73>r 4 Verriegeln*)
|
||||
END_VAR
|
||||
(*//1Spare*)
|
||||
VAR
|
||||
gbOuLightOn : BOOL; (*Anlagenbeleuchtung*)
|
||||
gbOuDarkfieldLight : BOOL; (*Dunkelfeldbeleuchtung f<>r Cam*)
|
||||
END_VAR
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
(*IF1.ST11 - X20DO9322*)
|
||||
(*----------------------------------------------------------------------------------------------------------------*)
|
||||
8
Logical/GlobalVars/Package.pkg
Normal file
8
Logical/GlobalVars/Package.pkg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.2.3.159?>
|
||||
<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>
|
||||
307
Logical/Libraries/ArEventLog/ArEventLog.fun
Normal file
307
Logical/Libraries/ArEventLog/ArEventLog.fun
Normal file
@@ -0,0 +1,307 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogCreate (*creates an event log module; asynchronous execution *)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Name : STRING[256]; (*name of the event log module*)
|
||||
Size : UDINT; (*size of the event log module*)
|
||||
Persistence : USINT; (*persistence type of the log module*)
|
||||
Info : UDINT; (*format of the additional data*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Busy : BOOL; (*execution running*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogAsyncInternalType;(*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogDelete (*deletes an event log module; asynchronous execution *)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Busy : BOOL; (*execution running*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogAsyncInternalType;(*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogGetIdent (*gets identifier of an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Name : STRING[256]; (*name of the event log module*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
Ident : ArEventLogIdentType; (*identifier of the event log module*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogWrite (*writes a log entry to an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
EventID : DINT; (*event id of the log entry*)
|
||||
OriginRecordID : ArEventLogRecordIDType; (*record id of basic cause of error/warning, or 0*)
|
||||
ObjectID : STRING[36]; (*object id - string of maximum 35 characters, string length of 0 object id is generated internally*)
|
||||
AddDataSize : UDINT; (*size of the additional data, or 0 (no additional data)*)
|
||||
AddDataFormat : USINT; (*format of the additional data*)
|
||||
AddData : UDINT; (*additional data of the entry given as pointer, or 0 (no additional data)*)
|
||||
TimeStamp : UDINT; (*external timestamp given as pointer to ArEventLogTimeStampType, or 0 (timestamp is taken internally)*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
RecordID : ArEventLogRecordIDType; (*id of current record*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogGetLatestRecordID (*gets latest record id*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
RecordID : ArEventLogRecordIDType; (*latest record id to read*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogGetPreviousRecordID (*gets previous record id*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*current record id*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
PrevRecordID : ArEventLogRecordIDType; (*previous record id to read*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogRead (*reads a log entry from an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*record id to read*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
EventID : DINT; (*event id of the log entry*)
|
||||
OriginRecordID : ArEventLogRecordIDType; (*record id of basic cause of error/warning, or 0*)
|
||||
AddDataFormat : USINT; (*format of the additional data*)
|
||||
AddDataSize : UDINT; (*size of the additional data*)
|
||||
TimeStamp : ArEventLogTimeStampType; (*timestamp*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogReadDescription (*reads a description of an event id*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*record id to read*)
|
||||
LanguageCode : ArEventLogLanguageCodeType;(*language id of description*)
|
||||
Qualifier : STRING[250]; (*additional qualifier - reserved for future use*)
|
||||
TextBuffer : UDINT; (*buffer for description*)
|
||||
TextBufferSize : UDINT; (*maximum description size*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Busy : BOOL; (*execution running*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
TextSize : UDINT; (*size of description (including 0-termination)*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogAsyncInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogReadErrorNumber (*reads an error number log entry from an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*record id to read*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
ErrorNumber : UDINT; (*error number of the log entry*)
|
||||
Severity : USINT; (*severity of the log entry*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogReadAddData (*reads the additional data from an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*record id to read*)
|
||||
AddData : UDINT; (*buffer for additional data given as pointer*)
|
||||
BytesToRead : UDINT; (*buffer size for additional data*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution status: see help*)
|
||||
AddDataSize : UDINT; (*size of the additional data*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArEventLogReadObjectID (*reads the object id from an event log module*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*enables execution*)
|
||||
Ident : ArEventLogIdentType; (*ident for the event log module to be written*)
|
||||
RecordID : ArEventLogRecordIDType; (*record id to read*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution done*)
|
||||
Error : BOOL; (*execution failed*)
|
||||
StatusID : DINT; (*execution error: see help*)
|
||||
ObjectID : STRING[36]; (*object id - string of maximum 35 characters*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
Internal : ArEventLogInternalType; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogMakeEventID : DINT (*makes an event id*)
|
||||
VAR_INPUT
|
||||
Severity : USINT; (*severity code of event id*)
|
||||
Facility : UINT; (*facility of event id*)
|
||||
ErrorCode : UINT; (*error code of event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogIsError : BOOL (*returns true if event id is an error entry*)
|
||||
VAR_INPUT
|
||||
EventID : DINT; (*event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogIsWarning : BOOL (*returns true if event id is a warning entry*)
|
||||
VAR_INPUT
|
||||
EventID : DINT; (*event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogIsInformation : BOOL (*returns true if event id is a information entry*)
|
||||
VAR_INPUT
|
||||
EventID : DINT; (*event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogIsSuccess : BOOL (*returns true if event id is a success entry*)
|
||||
VAR_INPUT
|
||||
EventID : DINT; (*event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION ArEventLogIsCustomerArea : BOOL (*returns true if the customer flag of the event id is set*)
|
||||
VAR_INPUT
|
||||
EventID : DINT; (*event id*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ArEventLogAddDataInit : BOOL (*returns true on success, false on failure*)
|
||||
VAR_INPUT
|
||||
Buffer : UDINT; (*buffer for additional event log data*)
|
||||
BufferSize : UDINT; (*buffer size*)
|
||||
Format : USINT; (*format of the additional data*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ArEventLogAddDataUdint : BOOL (*returns true on success, false on failure*)
|
||||
VAR_INPUT
|
||||
Buffer : UDINT; (*buffer for additional event data*)
|
||||
BufferSize : UDINT; (*buffer size*)
|
||||
Value : UDINT; (*UDINT value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ArEventLogAddDataDint : BOOL (*returns true on success, false on failure*)
|
||||
VAR_INPUT
|
||||
Buffer : UDINT; (*buffer for additional event data*)
|
||||
BufferSize : UDINT; (*buffer size*)
|
||||
Value : DINT; (*DINT value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ArEventLogAddDataString : BOOL (*returns true on success, false on failure*)
|
||||
VAR_INPUT
|
||||
Buffer : UDINT; (*buffer for additional event log data*)
|
||||
BufferSize : UDINT; (*buffer size*)
|
||||
Value : UDINT; (*STRING value, given as pointer to null terminated string*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ArEventLogAddDataQuantity : BOOL (*returns true on success, false on failure*)
|
||||
VAR_INPUT
|
||||
Buffer : UDINT; (*buffer for additional event log data*)
|
||||
BufferSize : UDINT; (*buffer size*)
|
||||
Value : LREAL; (*LREAL value*)
|
||||
UnitID : DINT; (*unit ID, -1 no unit*)
|
||||
NamespaceURI : UDINT; (*namespace URI given as pointer to null terminated string, null is default namespace (CEFACT)*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
20
Logical/Libraries/ArEventLog/ArEventLog.typ
Normal file
20
Logical/Libraries/ArEventLog/ArEventLog.typ
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
TYPE
|
||||
ArEventLogIdentType : UDINT;
|
||||
ArEventLogRecordIDType : UDINT;
|
||||
ArEventLogLanguageCodeType : STRING[18]; (*String-type for language ID*)
|
||||
|
||||
ArEventLogTimeStampType : STRUCT
|
||||
sec : UDINT; (*seconds*)
|
||||
nsec : UDINT; (*nano seconds*)
|
||||
END_STRUCT;
|
||||
|
||||
ArEventLogAsyncInternalType : STRUCT
|
||||
FBStateCtx : ArFBStateInternalType;
|
||||
AsyFuMaCtx : ArFBAsyFuMaInternalType;
|
||||
END_STRUCT;
|
||||
|
||||
ArEventLogInternalType : STRUCT
|
||||
FBStateCtx : ArFBStateInternalType;
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
42
Logical/Libraries/ArEventLog/ArEventLog.var
Normal file
42
Logical/Libraries/ArEventLog/ArEventLog.var
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
VAR CONSTANT
|
||||
arEVENTLOG_ERR_PARAMETER : DINT := -1070586096; (*obsolete - invalid parameters specified*)
|
||||
arEVENTLOG_ERR_RECORDID_INVALID : DINT := -1070586096; (*no record with the given id exists in the logbook*)
|
||||
arEVENTLOG_ERR_EXISTING : DINT := -1070586095; (*obsolete- log module already exists*)
|
||||
arEVENTLOG_ERR_LOGBOOK_EXISTS : DINT := -1070586095; (*a logbook with the given name already exists*)
|
||||
arEVENTLOG_ERR_INTERNAL : DINT := -1070586094; (*unexpected internal error*)
|
||||
arEVENTLOG_ERR_NAME_INVALID : DINT := -1070586093; (*the given name is invalid (empty)*)
|
||||
arEVENTLOG_ERR_SIZE_INVALID : DINT := -1070586092; (*the given size is smaller than the minimum size of a logbook*)
|
||||
arEVENTLOG_ERR_PERSISTENCE_INVAL : DINT := -1070586091; (*the given persistence level is unknown*)
|
||||
arEVENTLOG_ERR_IDENT_INVALID : DINT := -1070586090; (*the given ident is invalid (NULL)*)
|
||||
arEVENTLOG_ERR_IDENT_SYSTEM : DINT := -1070586089; (*access denied, the given ident belongs to a system logbook*)
|
||||
arEVENTLOG_ERR_EVENTID_INVALID : DINT := -1070586088; (*the given event id is no customer event id*)
|
||||
arEVENTLOG_ERR_LOGBOOK_NOT_FOUND : DINT := -1070586087; (*a logbook with the given name does not exist*)
|
||||
arEVENTLOG_ERR_ADDDATA_NULL : DINT := -1070586086; (*the given pointer to the additional data buffer is NULL*)
|
||||
arEVENTLOG_ERR_NO_ERRORNUMBER : DINT := -1070586085; (*the given record is no error number record*)
|
||||
arEVENTLOG_ERR_MODULE_EXISTS : DINT := -1070586084; (*another module with the given name already exists*)
|
||||
arEVENTLOG_ERR_NO_DESCRIPTION : DINT := -1070586083; (*no description was found for the given record id*)
|
||||
arEVENTLOG_ERR_DESCRIPTION_NULL : DINT := -1070586082; (*the given pointer to the description buffer is NULL*)
|
||||
arEVENTLOG_ERR_FORMAT_INVALID : DINT := -1070586081; (*the given format for the additional data is unknown*)
|
||||
|
||||
arEVENTLOG_WRN_NO_EVENTID : DINT := -2144327920; (*the given record is no event id record*)
|
||||
arEVENTLOG_WRN_FORMAT_INVALID : DINT := -2144327919; (*the given format for the additional data is unknown*)
|
||||
arEVENTLOG_WRN_ADDDATA_NULL : DINT := -2144327918; (*the given pointer to the additional data is NULL*)
|
||||
|
||||
arEVENTLOG_INF_SIZE : DINT := 1076897555; (*specified data size too small*)
|
||||
|
||||
arEVENTLOG_SEVERITY_SUCCESS : USINT := 0; (*severity code success*)
|
||||
arEVENTLOG_SEVERITY_INFO : USINT := 1; (*severity code informational*)
|
||||
arEVENTLOG_SEVERITY_WARNING : USINT := 2; (*severity code warning*)
|
||||
arEVENTLOG_SEVERITY_ERROR : USINT := 3; (*severity code error*)
|
||||
|
||||
arEVENTLOG_PERSISTENCE_VOLATILE : USINT := 0; (*persistence volatile*)
|
||||
arEVENTLOG_PERSISTENCE_REMANENT : USINT := 1; (*persistence remanent*)
|
||||
arEVENTLOG_PERSISTENCE_PERSIST : USINT := 2; (*persistence persistent*)
|
||||
|
||||
arEVENTLOG_ADDFORMAT_BINARY : USINT := 0; (*additional data format binary*)
|
||||
arEVENTLOG_ADDFORMAT_TEXT : USINT := 1; (*additional data format series of null terminated strings*)
|
||||
arEVENTLOG_ADDFORMAT_CODED : USINT := 2; (*additional data format binary coded data*)
|
||||
arEVENTLOG_ADDFORMAT_CUST_BASE : USINT := 100; (*additional data format begin of customer area*)
|
||||
arEVENTLOG_ADDFORMAT_CUST_MAX : USINT := 150; (*additional data format end of customer area*)
|
||||
END_VAR
|
||||
12
Logical/Libraries/ArEventLog/Binary.lby
Normal file
12
Logical/Libraries/ArEventLog/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The ArEventLog library can be used to collect additional error information and for further processing.">
|
||||
<Files>
|
||||
<File>ArEventLog.fun</File>
|
||||
<File>ArEventLog.typ</File>
|
||||
<File>ArEventLog.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
354
Logical/Libraries/ArEventLog/SG4/ArEventLog.h
Normal file
354
Logical/Libraries/ArEventLog/SG4/ArEventLog.h
Normal file
@@ -0,0 +1,354 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _AREVENTLOG_
|
||||
#define _AREVENTLOG_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define arEVENTLOG_ADDFORMAT_CUST_MAX 150U
|
||||
#define arEVENTLOG_ADDFORMAT_CUST_BASE 100U
|
||||
#define arEVENTLOG_ADDFORMAT_CODED 2U
|
||||
#define arEVENTLOG_ADDFORMAT_TEXT 1U
|
||||
#define arEVENTLOG_ADDFORMAT_BINARY 0U
|
||||
#define arEVENTLOG_PERSISTENCE_PERSIST 2U
|
||||
#define arEVENTLOG_PERSISTENCE_REMANENT 1U
|
||||
#define arEVENTLOG_PERSISTENCE_VOLATILE 0U
|
||||
#define arEVENTLOG_SEVERITY_ERROR 3U
|
||||
#define arEVENTLOG_SEVERITY_WARNING 2U
|
||||
#define arEVENTLOG_SEVERITY_INFO 1U
|
||||
#define arEVENTLOG_SEVERITY_SUCCESS 0U
|
||||
#define arEVENTLOG_INF_SIZE 1076897555
|
||||
#define arEVENTLOG_WRN_ADDDATA_NULL (-2144327918)
|
||||
#define arEVENTLOG_WRN_FORMAT_INVALID (-2144327919)
|
||||
#define arEVENTLOG_WRN_NO_EVENTID (-2144327920)
|
||||
#define arEVENTLOG_ERR_FORMAT_INVALID (-1070586081)
|
||||
#define arEVENTLOG_ERR_DESCRIPTION_NULL (-1070586082)
|
||||
#define arEVENTLOG_ERR_NO_DESCRIPTION (-1070586083)
|
||||
#define arEVENTLOG_ERR_MODULE_EXISTS (-1070586084)
|
||||
#define arEVENTLOG_ERR_NO_ERRORNUMBER (-1070586085)
|
||||
#define arEVENTLOG_ERR_ADDDATA_NULL (-1070586086)
|
||||
#define arEVENTLOG_ERR_LOGBOOK_NOT_FOUND (-1070586087)
|
||||
#define arEVENTLOG_ERR_EVENTID_INVALID (-1070586088)
|
||||
#define arEVENTLOG_ERR_IDENT_SYSTEM (-1070586089)
|
||||
#define arEVENTLOG_ERR_IDENT_INVALID (-1070586090)
|
||||
#define arEVENTLOG_ERR_PERSISTENCE_INVAL (-1070586091)
|
||||
#define arEVENTLOG_ERR_SIZE_INVALID (-1070586092)
|
||||
#define arEVENTLOG_ERR_NAME_INVALID (-1070586093)
|
||||
#define arEVENTLOG_ERR_INTERNAL (-1070586094)
|
||||
#define arEVENTLOG_ERR_LOGBOOK_EXISTS (-1070586095)
|
||||
#define arEVENTLOG_ERR_EXISTING (-1070586095)
|
||||
#define arEVENTLOG_ERR_RECORDID_INVALID (-1070586096)
|
||||
#define arEVENTLOG_ERR_PARAMETER (-1070586096)
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_ADDFORMAT_CUST_MAX;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_ADDFORMAT_CUST_BASE;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_ADDFORMAT_CODED;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_ADDFORMAT_TEXT;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_ADDFORMAT_BINARY;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_PERSISTENCE_PERSIST;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_PERSISTENCE_REMANENT;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_PERSISTENCE_VOLATILE;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_SEVERITY_ERROR;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_SEVERITY_WARNING;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_SEVERITY_INFO;
|
||||
_GLOBAL_CONST unsigned char arEVENTLOG_SEVERITY_SUCCESS;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_INF_SIZE;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_WRN_ADDDATA_NULL;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_WRN_FORMAT_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_WRN_NO_EVENTID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_FORMAT_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_DESCRIPTION_NULL;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_NO_DESCRIPTION;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_MODULE_EXISTS;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_NO_ERRORNUMBER;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_ADDDATA_NULL;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_LOGBOOK_NOT_FOUND;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_EVENTID_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_IDENT_SYSTEM;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_IDENT_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_PERSISTENCE_INVAL;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_SIZE_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_NAME_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_INTERNAL;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_LOGBOOK_EXISTS;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_EXISTING;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_RECORDID_INVALID;
|
||||
_GLOBAL_CONST signed long arEVENTLOG_ERR_PARAMETER;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct ArEventLogTimeStampType
|
||||
{ unsigned long sec;
|
||||
unsigned long nsec;
|
||||
} ArEventLogTimeStampType;
|
||||
|
||||
typedef struct ArEventLogAsyncInternalType
|
||||
{ struct ArFBStateInternalType FBStateCtx;
|
||||
struct ArFBAsyFuMaInternalType AsyFuMaCtx;
|
||||
} ArEventLogAsyncInternalType;
|
||||
|
||||
typedef struct ArEventLogInternalType
|
||||
{ struct ArFBStateInternalType FBStateCtx;
|
||||
} ArEventLogInternalType;
|
||||
|
||||
typedef unsigned long ArEventLogIdentType;
|
||||
|
||||
typedef struct ArEventLogCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcstring Name[257];
|
||||
unsigned long Size;
|
||||
unsigned char Persistence;
|
||||
unsigned long Info;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArEventLogIdentType Ident;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogAsyncInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArEventLogCreate_typ;
|
||||
|
||||
typedef struct ArEventLogDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogAsyncInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArEventLogDelete_typ;
|
||||
|
||||
typedef struct ArEventLogGetIdent
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcstring Name[257];
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArEventLogIdentType Ident;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogGetIdent_typ;
|
||||
|
||||
typedef unsigned long ArEventLogRecordIDType;
|
||||
|
||||
typedef struct ArEventLogWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
signed long EventID;
|
||||
ArEventLogRecordIDType OriginRecordID;
|
||||
plcstring ObjectID[37];
|
||||
unsigned long AddDataSize;
|
||||
unsigned char AddDataFormat;
|
||||
unsigned long AddData;
|
||||
unsigned long TimeStamp;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogWrite_typ;
|
||||
|
||||
typedef struct ArEventLogGetLatestRecordID
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogGetLatestRecordID_typ;
|
||||
|
||||
typedef struct ArEventLogGetPreviousRecordID
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArEventLogRecordIDType PrevRecordID;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogGetPreviousRecordID_typ;
|
||||
|
||||
typedef struct ArEventLogRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
signed long EventID;
|
||||
ArEventLogRecordIDType OriginRecordID;
|
||||
unsigned char AddDataFormat;
|
||||
unsigned long AddDataSize;
|
||||
struct ArEventLogTimeStampType TimeStamp;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogRead_typ;
|
||||
|
||||
typedef plcstring ArEventLogLanguageCodeType[19];
|
||||
|
||||
typedef struct ArEventLogReadDescription
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
ArEventLogLanguageCodeType LanguageCode;
|
||||
plcstring Qualifier[251];
|
||||
unsigned long TextBuffer;
|
||||
unsigned long TextBufferSize;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long TextSize;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogAsyncInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArEventLogReadDescription_typ;
|
||||
|
||||
typedef struct ArEventLogReadErrorNumber
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long ErrorNumber;
|
||||
unsigned char Severity;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogReadErrorNumber_typ;
|
||||
|
||||
typedef struct ArEventLogReadAddData
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
unsigned long AddData;
|
||||
unsigned long BytesToRead;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long AddDataSize;
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogReadAddData_typ;
|
||||
|
||||
typedef struct ArEventLogReadObjectID
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArEventLogIdentType Ident;
|
||||
ArEventLogRecordIDType RecordID;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
plcstring ObjectID[37];
|
||||
/* VAR (analog) */
|
||||
struct ArEventLogInternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Error;
|
||||
} ArEventLogReadObjectID_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void ArEventLogCreate(struct ArEventLogCreate* inst);
|
||||
_BUR_PUBLIC void ArEventLogDelete(struct ArEventLogDelete* inst);
|
||||
_BUR_PUBLIC void ArEventLogGetIdent(struct ArEventLogGetIdent* inst);
|
||||
_BUR_PUBLIC void ArEventLogWrite(struct ArEventLogWrite* inst);
|
||||
_BUR_PUBLIC void ArEventLogGetLatestRecordID(struct ArEventLogGetLatestRecordID* inst);
|
||||
_BUR_PUBLIC void ArEventLogGetPreviousRecordID(struct ArEventLogGetPreviousRecordID* inst);
|
||||
_BUR_PUBLIC void ArEventLogRead(struct ArEventLogRead* inst);
|
||||
_BUR_PUBLIC void ArEventLogReadDescription(struct ArEventLogReadDescription* inst);
|
||||
_BUR_PUBLIC void ArEventLogReadErrorNumber(struct ArEventLogReadErrorNumber* inst);
|
||||
_BUR_PUBLIC void ArEventLogReadAddData(struct ArEventLogReadAddData* inst);
|
||||
_BUR_PUBLIC void ArEventLogReadObjectID(struct ArEventLogReadObjectID* inst);
|
||||
_BUR_PUBLIC signed long ArEventLogMakeEventID(unsigned char Severity, unsigned short Facility, unsigned short ErrorCode);
|
||||
_BUR_PUBLIC plcbit ArEventLogIsError(signed long EventID);
|
||||
_BUR_PUBLIC plcbit ArEventLogIsWarning(signed long EventID);
|
||||
_BUR_PUBLIC plcbit ArEventLogIsInformation(signed long EventID);
|
||||
_BUR_PUBLIC plcbit ArEventLogIsSuccess(signed long EventID);
|
||||
_BUR_PUBLIC plcbit ArEventLogIsCustomerArea(signed long EventID);
|
||||
_BUR_PUBLIC plcbit ArEventLogAddDataInit(unsigned long Buffer, unsigned long BufferSize, unsigned char Format);
|
||||
_BUR_PUBLIC plcbit ArEventLogAddDataUdint(unsigned long Buffer, unsigned long BufferSize, unsigned long Value);
|
||||
_BUR_PUBLIC plcbit ArEventLogAddDataDint(unsigned long Buffer, unsigned long BufferSize, signed long Value);
|
||||
_BUR_PUBLIC plcbit ArEventLogAddDataString(unsigned long Buffer, unsigned long BufferSize, unsigned long Value);
|
||||
_BUR_PUBLIC plcbit ArEventLogAddDataQuantity(unsigned long Buffer, unsigned long BufferSize, double Value, signed long UnitID, unsigned long NamespaceURI);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _AREVENTLOG_ */
|
||||
|
||||
123
Logical/Libraries/ArTextSys/ArTextSys.fun
Normal file
123
Logical/Libraries/ArTextSys/ArTextSys.fun
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysGetSystemLanguage (*determine preferred user-language*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*start on rising edge*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution successful. FB finished*)
|
||||
Busy : BOOL; (*FB is still active; needs call*)
|
||||
Error : BOOL;
|
||||
StatusID : DINT;
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysExec1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysSetSystemLanguage (*update preferred user-language*)
|
||||
VAR_INPUT
|
||||
Execute : BOOL;
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL;
|
||||
Busy : BOOL;
|
||||
Error : BOOL; (*error occurred during operation*)
|
||||
StatusID : DINT;
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysExec1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysGetNamespaceLanguages
|
||||
VAR_INPUT
|
||||
Execute : BOOL; (*start on rising edge*)
|
||||
Namespace : UDINT; (*string-pointer to namespace*)
|
||||
First : BOOL; (*get first entry; or next*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution successful. FB finished*)
|
||||
Busy : BOOL; (*FB is still active; needs call*)
|
||||
Error : BOOL; (*error occurred during operation*)
|
||||
StatusID : DINT;
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
EndOfList : BOOL; (*indicator for last found entry*)
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysIter1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysGetText
|
||||
VAR_INPUT
|
||||
Execute : BOOL;
|
||||
Namespace : UDINT; (*string-pointer to namespace*)
|
||||
TextID : UDINT; (*string-pointer to text-key*)
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
TextBufferSize : UDINT; (*size of result-buffer to get text*)
|
||||
TextBuffer : UDINT; (*pointer to text result-buffer*)
|
||||
SearchMode : ArTextSysSearchModeEnum;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution successful. FB finished*)
|
||||
Busy : BOOL; (*FB is still active; needs call*)
|
||||
Error : BOOL; (*error occurred during operation*)
|
||||
StatusID : DINT;
|
||||
TextSize : UDINT; (*Length of text in result-buffer*)
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysExec1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysFormatString
|
||||
VAR_INPUT
|
||||
Execute : BOOL;
|
||||
FormatString : UDINT; (*string-pointer to format-template*)
|
||||
ArgumentCount : UINT; (*count of arguments in list*)
|
||||
ArgumentList : ARRAY[0..9] OF ArTextSysFormatArgumentType;
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
MeasurementCode : UDINT;
|
||||
TextBufferSize : UDINT; (*size of result-buffer to get text*)
|
||||
TextBuffer : UDINT; (*pointer to result-buffer*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution successful. FB finished*)
|
||||
Busy : BOOL; (*FB is still active; needs call*)
|
||||
Error : BOOL; (*error occurred during operation*)
|
||||
StatusID : DINT;
|
||||
TextSize : UDINT; (*Length of text in result-buffer*)
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysExec1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ArTextSysGetFormattedText
|
||||
VAR_INPUT
|
||||
Execute : BOOL;
|
||||
Namespace : UDINT; (*string-pointer to namespace*)
|
||||
TextID : UDINT; (*string-pointer to text-key*)
|
||||
ArgumentCount : UINT; (*count of arguments in list*)
|
||||
ArgumentList : ARRAY[0..9] OF ArTextSysFormatArgumentType;
|
||||
LanguageCode : ArTextSysLanguageCodeType;
|
||||
MeasurementCode : UDINT;
|
||||
TextBufferSize : UDINT; (*size of result-buffer to get text*)
|
||||
TextBuffer : UDINT; (*pointer to result-buffer*)
|
||||
SearchMode : ArTextSysSearchModeEnum;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Done : BOOL; (*execution successful. FB finished*)
|
||||
Busy : BOOL; (*FB is still active; needs call*)
|
||||
Error : BOOL; (*error occurred during operation*)
|
||||
StatusID : DINT;
|
||||
TextSize : UDINT; (*Length of text in result-buffer*)
|
||||
END_VAR
|
||||
VAR (*internals*)
|
||||
Internal : ArTextSysExec1InternalType;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
32
Logical/Libraries/ArTextSys/ArTextSys.typ
Normal file
32
Logical/Libraries/ArTextSys/ArTextSys.typ
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
TYPE
|
||||
ArTextSysLanguageCodeType : STRING[18]; (*String-type for language ID*)
|
||||
|
||||
(*Enumeration for ArTextSysGetText-FUBs*)
|
||||
ArTextSysSearchModeEnum :
|
||||
(
|
||||
arTEXTSYS_SEARCH_FALLBACK_SUBST, (*with fallback-languages or substitute*)
|
||||
arTEXTSYS_SEARCH_LANGUAGE_ONLY, (*search for matching language only*)
|
||||
arTEXTSYS_SEARCH_FALLBACK (*with fallback-searches, no substitute*)
|
||||
);
|
||||
|
||||
(*argument-properties for formatter*)
|
||||
ArTextSysFormatArgumentType : STRUCT
|
||||
Datatype : UINT; (*type of argument; eg. IEC_DATATYPE_UDINT*)
|
||||
Data : UDINT; (*pointer to Argument*)
|
||||
UnitNamespace : UDINT; (*namespace of UnitID; default OPC-UA recommended*)
|
||||
UnitID : UDINT;
|
||||
END_STRUCT;
|
||||
|
||||
(*Internal type(s) for FUB-processing*)
|
||||
ArTextSysExec1InternalType : STRUCT
|
||||
i_serno : UINT;
|
||||
i_state : UINT;
|
||||
Result : DINT;
|
||||
END_STRUCT;
|
||||
|
||||
ArTextSysIter1InternalType : STRUCT
|
||||
i_base : ArTextSysExec1InternalType;
|
||||
m_iter : DINT; (*internal iterator; eg. ArTextSysGetNamespaceLanguages*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
21
Logical/Libraries/ArTextSys/ArTextSys.var
Normal file
21
Logical/Libraries/ArTextSys/ArTextSys.var
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
VAR CONSTANT
|
||||
arTEXTSYS_ERR_OUT_OF_MEMORY : UDINT := 16#C030_280A; (*fatal error: out of memory*)
|
||||
arTEXTSYS_ERR_INVALID_ARG : UDINT := 16#8030_280B; (*provided argument is invalid*)
|
||||
arTEXTSYS_ERR_FAILED : UDINT := 16#8030_280C; (*internal operation failure*)
|
||||
arTEXTSYS_ERR_ACCESS_DENIED : UDINT := 16#8030_280D; (*resource-access denied*)
|
||||
arTEXTSYS_ERR_INVALID_HANDLE : UDINT := 16#8030_280E; (*invalid handle detected*)
|
||||
|
||||
arTEXTSYS_ERR_CANT_OPEN_TEXTDB : UDINT := 16#8030_2811; (*opening of text-db failed*)
|
||||
arTEXTSYS_INF_ALREADY_OPENED : DINT := 16#4030_2812; (*text-db is open and ready*)
|
||||
arTEXTSYS_ERR_TEXTDB_SCHEMA : UDINT := 16#8030_2813; (*unrecognised text-db schema or structure*)
|
||||
arTEXTSYS_ERR_TEXTDB_READER : UDINT := 16#8030_2814; (*read of open text-db failed*)
|
||||
arTEXTSYS_ERR_TEXTDB_INTERNAL : UDINT := 16#8030_2815; (*other kind of text-db error*)
|
||||
arTEXTSYS_INF_NOT_SET_DURABLE : DINT := 16#4030_2816; (*configuration-change is not durable*)
|
||||
|
||||
arTEXTSYS_ERR_NO_TEXT_FOUND : UDINT := 16#8030_2818; (*no requested text found*)
|
||||
arTEXTSYS_INF_LANGUAGE_DIFFERS : DINT := 16#4030_281A; (*text-language differs; not in requested language*)
|
||||
arTEXTSYS_INF_SUBSTITUTE_TEXT : DINT := 16#4030_281B; (*no text found, but substitute-text provided*)
|
||||
arTEXTSYS_ERR_NOT_EXISTS : UDINT := 16#8030_281C; (*record not found; doesn't exist*)
|
||||
arTEXTSYS_ERR_END_REACHED : UDINT := 16#8030_281D; (*no further suitable entry found*)
|
||||
END_VAR
|
||||
9
Logical/Libraries/ArTextSys/Binary.lby
Normal file
9
Logical/Libraries/ArTextSys/Binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="IEC Text-System Library.">
|
||||
<Files>
|
||||
<File>ArTextSys.fun</File>
|
||||
<File>ArTextSys.typ</File>
|
||||
<File>ArTextSys.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
221
Logical/Libraries/ArTextSys/SG4/ArTextSys.h
Normal file
221
Logical/Libraries/ArTextSys/SG4/ArTextSys.h
Normal file
@@ -0,0 +1,221 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ARTEXTSYS_
|
||||
#define _ARTEXTSYS_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define arTEXTSYS_ERR_END_REACHED 2150639645U
|
||||
#define arTEXTSYS_ERR_NOT_EXISTS 2150639644U
|
||||
#define arTEXTSYS_INF_SUBSTITUTE_TEXT 1076897819
|
||||
#define arTEXTSYS_INF_LANGUAGE_DIFFERS 1076897818
|
||||
#define arTEXTSYS_ERR_NO_TEXT_FOUND 2150639640U
|
||||
#define arTEXTSYS_INF_NOT_SET_DURABLE 1076897814
|
||||
#define arTEXTSYS_ERR_TEXTDB_INTERNAL 2150639637U
|
||||
#define arTEXTSYS_ERR_TEXTDB_READER 2150639636U
|
||||
#define arTEXTSYS_ERR_TEXTDB_SCHEMA 2150639635U
|
||||
#define arTEXTSYS_INF_ALREADY_OPENED 1076897810
|
||||
#define arTEXTSYS_ERR_CANT_OPEN_TEXTDB 2150639633U
|
||||
#define arTEXTSYS_ERR_INVALID_HANDLE 2150639630U
|
||||
#define arTEXTSYS_ERR_ACCESS_DENIED 2150639629U
|
||||
#define arTEXTSYS_ERR_FAILED 2150639628U
|
||||
#define arTEXTSYS_ERR_INVALID_ARG 2150639627U
|
||||
#define arTEXTSYS_ERR_OUT_OF_MEMORY 3224381450U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_END_REACHED;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_NOT_EXISTS;
|
||||
_GLOBAL_CONST signed long arTEXTSYS_INF_SUBSTITUTE_TEXT;
|
||||
_GLOBAL_CONST signed long arTEXTSYS_INF_LANGUAGE_DIFFERS;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_NO_TEXT_FOUND;
|
||||
_GLOBAL_CONST signed long arTEXTSYS_INF_NOT_SET_DURABLE;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_TEXTDB_INTERNAL;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_TEXTDB_READER;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_TEXTDB_SCHEMA;
|
||||
_GLOBAL_CONST signed long arTEXTSYS_INF_ALREADY_OPENED;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_CANT_OPEN_TEXTDB;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_INVALID_HANDLE;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_ACCESS_DENIED;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_FAILED;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_INVALID_ARG;
|
||||
_GLOBAL_CONST unsigned long arTEXTSYS_ERR_OUT_OF_MEMORY;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef enum ArTextSysSearchModeEnum
|
||||
{ arTEXTSYS_SEARCH_FALLBACK_SUBST,
|
||||
arTEXTSYS_SEARCH_LANGUAGE_ONLY,
|
||||
arTEXTSYS_SEARCH_FALLBACK
|
||||
} ArTextSysSearchModeEnum;
|
||||
|
||||
typedef struct ArTextSysFormatArgumentType
|
||||
{ unsigned short Datatype;
|
||||
unsigned long Data;
|
||||
unsigned long UnitNamespace;
|
||||
unsigned long UnitID;
|
||||
} ArTextSysFormatArgumentType;
|
||||
|
||||
typedef struct ArTextSysExec1InternalType
|
||||
{ unsigned short i_serno;
|
||||
unsigned short i_state;
|
||||
signed long Result;
|
||||
} ArTextSysExec1InternalType;
|
||||
|
||||
typedef struct ArTextSysIter1InternalType
|
||||
{ struct ArTextSysExec1InternalType i_base;
|
||||
signed long m_iter;
|
||||
} ArTextSysIter1InternalType;
|
||||
|
||||
typedef plcstring ArTextSysLanguageCodeType[19];
|
||||
|
||||
typedef struct ArTextSysGetSystemLanguage
|
||||
{
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysExec1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArTextSysGetSystemLanguage_typ;
|
||||
|
||||
typedef struct ArTextSysSetSystemLanguage
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysExec1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArTextSysSetSystemLanguage_typ;
|
||||
|
||||
typedef struct ArTextSysGetNamespaceLanguages
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long Namespace;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysIter1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
plcbit First;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
plcbit EndOfList;
|
||||
} ArTextSysGetNamespaceLanguages_typ;
|
||||
|
||||
typedef struct ArTextSysGetText
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long Namespace;
|
||||
unsigned long TextID;
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
unsigned long TextBufferSize;
|
||||
unsigned long TextBuffer;
|
||||
enum ArTextSysSearchModeEnum SearchMode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long TextSize;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysExec1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArTextSysGetText_typ;
|
||||
|
||||
typedef struct ArTextSysFormatString
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long FormatString;
|
||||
unsigned short ArgumentCount;
|
||||
struct ArTextSysFormatArgumentType ArgumentList[10];
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
unsigned long MeasurementCode;
|
||||
unsigned long TextBufferSize;
|
||||
unsigned long TextBuffer;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long TextSize;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysExec1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArTextSysFormatString_typ;
|
||||
|
||||
typedef struct ArTextSysGetFormattedText
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long Namespace;
|
||||
unsigned long TextID;
|
||||
unsigned short ArgumentCount;
|
||||
struct ArTextSysFormatArgumentType ArgumentList[10];
|
||||
ArTextSysLanguageCodeType LanguageCode;
|
||||
unsigned long MeasurementCode;
|
||||
unsigned long TextBufferSize;
|
||||
unsigned long TextBuffer;
|
||||
enum ArTextSysSearchModeEnum SearchMode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
signed long StatusID;
|
||||
unsigned long TextSize;
|
||||
/* VAR (analog) */
|
||||
struct ArTextSysExec1InternalType Internal;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit Execute;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Done;
|
||||
plcbit Busy;
|
||||
plcbit Error;
|
||||
} ArTextSysGetFormattedText_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void ArTextSysGetSystemLanguage(struct ArTextSysGetSystemLanguage* inst);
|
||||
_BUR_PUBLIC void ArTextSysSetSystemLanguage(struct ArTextSysSetSystemLanguage* inst);
|
||||
_BUR_PUBLIC void ArTextSysGetNamespaceLanguages(struct ArTextSysGetNamespaceLanguages* inst);
|
||||
_BUR_PUBLIC void ArTextSysGetText(struct ArTextSysGetText* inst);
|
||||
_BUR_PUBLIC void ArTextSysFormatString(struct ArTextSysFormatString* inst);
|
||||
_BUR_PUBLIC void ArTextSysGetFormattedText(struct ArTextSysGetFormattedText* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ARTEXTSYS_ */
|
||||
|
||||
1344
Logical/Libraries/AsARCfg/AsARCfg.fun
Normal file
1344
Logical/Libraries/AsARCfg/AsARCfg.fun
Normal file
File diff suppressed because it is too large
Load Diff
11
Logical/Libraries/AsARCfg/AsARCfg.typ
Normal file
11
Logical/Libraries/AsARCfg/AsARCfg.typ
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
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
|
||||
88
Logical/Libraries/AsARCfg/AsARCfg.var
Normal file
88
Logical/Libraries/AsARCfg/AsARCfg.var
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
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*)
|
||||
cfgERR_DST : UINT := 29035; (*could not enable or disable automatic daylight saving*)
|
||||
|
||||
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*)
|
||||
|
||||
cfgDHCP_OPTION_VENDOR_CLASS_ID : USINT := 60; (*DHCP option vendor class identifier*)
|
||||
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsARCfg/Binary.lby
Normal file
12
Logical/Libraries/AsARCfg/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsARCfg library supports reading and writing Automation Runtime configurations.">
|
||||
<Files>
|
||||
<File>AsARCfg.fun</File>
|
||||
<File>AsARCfg.typ</File>
|
||||
<File>AsARCfg.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
204
Logical/Libraries/AsARCfg/SG3/AsARCfg.h
Normal file
204
Logical/Libraries/AsARCfg/SG3/AsARCfg.h
Normal 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_ */
|
||||
|
||||
|
||||
1378
Logical/Libraries/AsARCfg/SG4/AsARCfg.h
Normal file
1378
Logical/Libraries/AsARCfg/SG4/AsARCfg.h
Normal file
File diff suppressed because it is too large
Load Diff
272
Logical/Libraries/AsARCfg/SGC/AsARCfg.h
Normal file
272
Logical/Libraries/AsARCfg/SGC/AsARCfg.h
Normal 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_ */
|
||||
|
||||
|
||||
124
Logical/Libraries/AsArLog/AsArLog.fun
Normal file
124
Logical/Libraries/AsArLog/AsArLog.fun
Normal file
@@ -0,0 +1,124 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsArLogCreate (*creates an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pName : UDINT; (*name of the AR logger user module to be created give as a pointer, e.g. "vclog".*)
|
||||
len : UDINT; (*length of the log data area*)
|
||||
memType : UDINT; (*memory type on the target: arlogDRAM, arlogUSRRAM, arlogUSRROM*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : 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; (*ident of the AR logger basis module to be generated*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK AsArLogDelete (*deletes an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident of the AR logger user module to be deleted*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : 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 AsArLogWrite (*writes a log entry to a AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident for the AR logger module to be written (user module or base module)*)
|
||||
logLevel : UDINT; (*log level of the log entry*)
|
||||
errornr : UDINT; (*error number of the entry*)
|
||||
mem : UDINT; (*binary log data given as a pointer*)
|
||||
len : UDINT; (*length of the binary log data in bytes*)
|
||||
asciiString : UDINT; (*log-specific zero-terminated ASCII string give as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
intTaskName : ARRAY[0..35] OF USINT; (*internal variable*)
|
||||
intRtkTime : ARRAY[0..3] OF 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 AsArLogRead (*reads a log entry from a AR logger module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident for the AR logger module to be read (user module or base module)*)
|
||||
index : UDINT; (*index of the log entry to be read*)
|
||||
arlogRead : UDINT; (*specifies read structure (given as a pointer) where the header data for the log entry can be copied*)
|
||||
memBin : UDINT; (*buffer for binary log data given as a pointer (if NULL, no binary log data is copied)*)
|
||||
lenBin : UDINT; (*number of binary log data bytes to be read (if NULL, no binary log data is copied)*)
|
||||
memAscii : UDINT; (*buffer for ASCII string given as a pointer*)
|
||||
lenAscii : UDINT; (*number of bytes to be read for the ASCII string*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : 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 AsArLogClear (*deletes or reinitializes the log data in an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident of the AR logger user module to be reinitialized*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : 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 AsArLogGetInfo (*reads information from a self-generated AR logger user module or AR logger base user module*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pName : UDINT; (*name of the AR logger user module (e.g. "vclog") given as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident : UDINT; (*ident of the AR logger BR module*)
|
||||
len : UDINT; (*length of the log data area*)
|
||||
memType : UDINT; (*memory type on the target*)
|
||||
actualIndex : UDINT; (*current entry index in the specified AR logger BR module*)
|
||||
FormatVer : UDINT; (*version of de log data format*)
|
||||
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
20
Logical/Libraries/AsArLog/AsArLog.typ
Normal file
20
Logical/Libraries/AsArLog/AsArLog.typ
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
TYPE
|
||||
asarlogRead : STRUCT
|
||||
len : UDINT; (*length of the entire log entry (header + binary log data + ASCII string)*)
|
||||
lenBin : UDINT; (*length of the binary log data*)
|
||||
lenAscii : UDINT; (*length of the ASCII log data*)
|
||||
logLevel : UDINT; (*log level of the log entry*)
|
||||
errornr : UDINT; (*error number of the entry*)
|
||||
taskName : ARRAY[0..35] OF USINT; (*task name*)
|
||||
errYear : UDINT; (*year (date of error)*)
|
||||
errMonth : UDINT; (*month (date of error)*)
|
||||
errDay : UDINT; (*day (date of error)*)
|
||||
errHour : UDINT; (*hour (time of error)*)
|
||||
errMinute : UDINT; (*minute (time of error)*)
|
||||
errSecond : UDINT; (*second (time of error)*)
|
||||
errMilliSec : UDINT; (*millisecond (time of error)*)
|
||||
errMicroSec : UDINT; (*microsecond (time of error)*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
45
Logical/Libraries/AsArLog/AsArLog.var
Normal file
45
Logical/Libraries/AsArLog/AsArLog.var
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
VAR CONSTANT
|
||||
arlogDRAM : USINT := 65; (*temporary AR log modules (DRAM)*)
|
||||
arlogUSRRAM : USINT := 3; (*USERRAM*)
|
||||
arlogUSRROM : USINT := 2; (*USERROM (USER FLASH)*)
|
||||
|
||||
arlogLEVEL_INFO : UDINT := 1; (*log level INFO*)
|
||||
arlogLEVEL_WARNING : UDINT := 2; (*log level WARNING*)
|
||||
arlogLEVEL_FATAL : UDINT := 3; (*log level FATAL*)
|
||||
|
||||
arlogMIN_LOGDATA_SIZE : UINT := 4096; (*minimum log data size of 4 KB*)
|
||||
|
||||
arlogBASE_SYSTEM_LOG_IDENT : UDINT := 0; (*fixed ID for the "$arlogsys" base system module*)
|
||||
arlogBASE_USER_LOG_IDENT : UDINT := 1; (*fixed ID for the "$arlogusr" base user module*)
|
||||
arlogBASE_FIELDBUS_LOG_IDENT : UDINT := 2; (*fixed ID for the "fieldbus" logger module*)
|
||||
arlogBASE_SAFETY_LOG_IDENT : UDINT := 3; (*fixed ID for the "safety" logger module*)
|
||||
arlogBASE_REDUND_LOG_IDENT : UDINT := 4; (*fixed ID for the "redund" logger module*)
|
||||
|
||||
arlogERR_ILL_NAME : UINT := 31400; (*incorrect or invalid name*)
|
||||
arlogERR_ILL_MEMTYPE : UINT := 31401; (*incorrect memory type*)
|
||||
arlogERR_ILL_LOGLEVEL : UINT := 31402; (*invalid log level (only arlogLEVEL_INFO, arlogLEVEL_WARNING, and arlogLEVEL_FATAL valid)*)
|
||||
arlogERR_ILL_PARAM : UINT := 31403; (*invalid parameters specified*)
|
||||
arlogERR_ILL_LEN : UINT := 31404; (*incorrect log data length. Must be >= arlogMIN_LOGDATA_SIZE (4096 bytes)*)
|
||||
arlogERR_EXISTING : UINT := 31405; (*log module already exists*)
|
||||
arlogERR_CREATE : UINT := 31406; (*general create error (create failed)*)
|
||||
arlogERR_INSTALL : UINT := 31407; (*install error for AsArLogCreate*)
|
||||
arlogERR_ACCESS_DENIED : UINT := 31408; (*cannot access the "$arlogsys" and "$arlogusr" base log modules*)
|
||||
arlogERR_IN_ACCESS : UINT := 31409; (*access denied since other critical FBK simultaneously active*)
|
||||
arlogERR_INVALID_IDENT : UINT := 31410; (*invalid ident specified*)
|
||||
arlogERR_DELETE : UINT := 31411; (*general delete error (delete failed)*)
|
||||
|
||||
arlogERR_NOMEMORY : UINT := 31412; (*not enough buffer to copy*)
|
||||
arlogERR_NOTEXISTING : UINT := 31416; (*AR log module doesn't exist*)
|
||||
|
||||
arlogERR_WRITE : UINT := 31417; (*general write error (write failed)*)
|
||||
arlogERR_WRITE_CALC_DATA : UINT := 31418; (*error calculating referencing index*)
|
||||
|
||||
arlogERR_READ : UINT := 31419; (*general read error (read failed)*)
|
||||
arlogERR_READ_BUFFER : UINT := 31420; (*invalid buffer specified*)
|
||||
arlogERR_INVALID_INDEX : UINT := 31421; (*invalid index (smaller than the reference index and larger than the current index)*)
|
||||
arlogERR_INVALID_ENTRY : UINT := 31422; (*invalid log entry read*)
|
||||
arlogERR_READ_BINARY_BUFFER : UINT := 31423; (*buffer length for binary data too small*)
|
||||
arlogERR_READ_ASCII_BUFFER : UINT := 31424; (*buffer length for ASCII data too small*)
|
||||
arlogERR_NO_MORE_ENTRY : UINT := 31425; (*FBK still working*)
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsArLog/Binary.lby
Normal file
12
Logical/Libraries/AsArLog/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="OBSOLETE - The AsArLog library is replaced by ArEventLog and exists only for compatibility reasons.">
|
||||
<Files>
|
||||
<File>AsArLog.fun</File>
|
||||
<File>AsArLog.typ</File>
|
||||
<File>AsArLog.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
237
Logical/Libraries/AsArLog/SG4/AsArLog.h
Normal file
237
Logical/Libraries/AsArLog/SG4/AsArLog.h
Normal file
@@ -0,0 +1,237 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASARLOG_
|
||||
#define _ASARLOG_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define arlogERR_NO_MORE_ENTRY 31425U
|
||||
#define arlogERR_READ_ASCII_BUFFER 31424U
|
||||
#define arlogERR_READ_BINARY_BUFFER 31423U
|
||||
#define arlogERR_INVALID_ENTRY 31422U
|
||||
#define arlogERR_INVALID_INDEX 31421U
|
||||
#define arlogERR_READ_BUFFER 31420U
|
||||
#define arlogERR_READ 31419U
|
||||
#define arlogERR_WRITE_CALC_DATA 31418U
|
||||
#define arlogERR_WRITE 31417U
|
||||
#define arlogERR_NOTEXISTING 31416U
|
||||
#define arlogERR_NOMEMORY 31412U
|
||||
#define arlogERR_DELETE 31411U
|
||||
#define arlogERR_INVALID_IDENT 31410U
|
||||
#define arlogERR_IN_ACCESS 31409U
|
||||
#define arlogERR_ACCESS_DENIED 31408U
|
||||
#define arlogERR_INSTALL 31407U
|
||||
#define arlogERR_CREATE 31406U
|
||||
#define arlogERR_EXISTING 31405U
|
||||
#define arlogERR_ILL_LEN 31404U
|
||||
#define arlogERR_ILL_PARAM 31403U
|
||||
#define arlogERR_ILL_LOGLEVEL 31402U
|
||||
#define arlogERR_ILL_MEMTYPE 31401U
|
||||
#define arlogERR_ILL_NAME 31400U
|
||||
#define arlogBASE_REDUND_LOG_IDENT 4U
|
||||
#define arlogBASE_SAFETY_LOG_IDENT 3U
|
||||
#define arlogBASE_FIELDBUS_LOG_IDENT 2U
|
||||
#define arlogBASE_USER_LOG_IDENT 1U
|
||||
#define arlogBASE_SYSTEM_LOG_IDENT 0U
|
||||
#define arlogMIN_LOGDATA_SIZE 4096U
|
||||
#define arlogLEVEL_FATAL 3U
|
||||
#define arlogLEVEL_WARNING 2U
|
||||
#define arlogLEVEL_INFO 1U
|
||||
#define arlogUSRROM 2U
|
||||
#define arlogUSRRAM 3U
|
||||
#define arlogDRAM 65U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned short arlogERR_NO_MORE_ENTRY;
|
||||
_GLOBAL_CONST unsigned short arlogERR_READ_ASCII_BUFFER;
|
||||
_GLOBAL_CONST unsigned short arlogERR_READ_BINARY_BUFFER;
|
||||
_GLOBAL_CONST unsigned short arlogERR_INVALID_ENTRY;
|
||||
_GLOBAL_CONST unsigned short arlogERR_INVALID_INDEX;
|
||||
_GLOBAL_CONST unsigned short arlogERR_READ_BUFFER;
|
||||
_GLOBAL_CONST unsigned short arlogERR_READ;
|
||||
_GLOBAL_CONST unsigned short arlogERR_WRITE_CALC_DATA;
|
||||
_GLOBAL_CONST unsigned short arlogERR_WRITE;
|
||||
_GLOBAL_CONST unsigned short arlogERR_NOTEXISTING;
|
||||
_GLOBAL_CONST unsigned short arlogERR_NOMEMORY;
|
||||
_GLOBAL_CONST unsigned short arlogERR_DELETE;
|
||||
_GLOBAL_CONST unsigned short arlogERR_INVALID_IDENT;
|
||||
_GLOBAL_CONST unsigned short arlogERR_IN_ACCESS;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ACCESS_DENIED;
|
||||
_GLOBAL_CONST unsigned short arlogERR_INSTALL;
|
||||
_GLOBAL_CONST unsigned short arlogERR_CREATE;
|
||||
_GLOBAL_CONST unsigned short arlogERR_EXISTING;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ILL_LEN;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ILL_PARAM;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ILL_LOGLEVEL;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ILL_MEMTYPE;
|
||||
_GLOBAL_CONST unsigned short arlogERR_ILL_NAME;
|
||||
_GLOBAL_CONST unsigned long arlogBASE_REDUND_LOG_IDENT;
|
||||
_GLOBAL_CONST unsigned long arlogBASE_SAFETY_LOG_IDENT;
|
||||
_GLOBAL_CONST unsigned long arlogBASE_FIELDBUS_LOG_IDENT;
|
||||
_GLOBAL_CONST unsigned long arlogBASE_USER_LOG_IDENT;
|
||||
_GLOBAL_CONST unsigned long arlogBASE_SYSTEM_LOG_IDENT;
|
||||
_GLOBAL_CONST unsigned short arlogMIN_LOGDATA_SIZE;
|
||||
_GLOBAL_CONST unsigned long arlogLEVEL_FATAL;
|
||||
_GLOBAL_CONST unsigned long arlogLEVEL_WARNING;
|
||||
_GLOBAL_CONST unsigned long arlogLEVEL_INFO;
|
||||
_GLOBAL_CONST unsigned char arlogUSRROM;
|
||||
_GLOBAL_CONST unsigned char arlogUSRRAM;
|
||||
_GLOBAL_CONST unsigned char arlogDRAM;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct asarlogRead
|
||||
{ unsigned long len;
|
||||
unsigned long lenBin;
|
||||
unsigned long lenAscii;
|
||||
unsigned long logLevel;
|
||||
unsigned long errornr;
|
||||
unsigned char taskName[36];
|
||||
unsigned long errYear;
|
||||
unsigned long errMonth;
|
||||
unsigned long errDay;
|
||||
unsigned long errHour;
|
||||
unsigned long errMinute;
|
||||
unsigned long errSecond;
|
||||
unsigned long errMilliSec;
|
||||
unsigned long errMicroSec;
|
||||
} asarlogRead;
|
||||
|
||||
typedef struct AsArLogCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
unsigned long len;
|
||||
unsigned long memType;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogCreate_typ;
|
||||
|
||||
typedef struct AsArLogDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogDelete_typ;
|
||||
|
||||
typedef struct AsArLogWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long logLevel;
|
||||
unsigned long errornr;
|
||||
unsigned long mem;
|
||||
unsigned long len;
|
||||
unsigned long asciiString;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
unsigned char intTaskName[36];
|
||||
unsigned long intRtkTime[4];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogWrite_typ;
|
||||
|
||||
typedef struct AsArLogRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long index;
|
||||
unsigned long arlogRead;
|
||||
unsigned long memBin;
|
||||
unsigned long lenBin;
|
||||
unsigned long memAscii;
|
||||
unsigned long lenAscii;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogRead_typ;
|
||||
|
||||
typedef struct AsArLogClear
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogClear_typ;
|
||||
|
||||
typedef struct AsArLogGetInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long len;
|
||||
unsigned long memType;
|
||||
unsigned long actualIndex;
|
||||
unsigned long FormatVer;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogGetInfo_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void AsArLogCreate(struct AsArLogCreate* inst);
|
||||
_BUR_PUBLIC void AsArLogDelete(struct AsArLogDelete* inst);
|
||||
_BUR_PUBLIC void AsArLogWrite(struct AsArLogWrite* inst);
|
||||
_BUR_PUBLIC void AsArLogRead(struct AsArLogRead* inst);
|
||||
_BUR_PUBLIC void AsArLogClear(struct AsArLogClear* inst);
|
||||
_BUR_PUBLIC void AsArLogGetInfo(struct AsArLogGetInfo* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASARLOG_ */
|
||||
|
||||
39
Logical/Libraries/AsArSdm/AsArSdm.fun
Normal file
39
Logical/Libraries/AsArSdm/AsArSdm.fun
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SdmSystemDump (*SDM - create a system dump; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
configuration : UDINT; (*cfgSDM_SYSTEMDUMP_PARAM(0) parameters only or cfgSDM_SYSTEMDUMP_DATA(1) parameters and data-files*)
|
||||
pDevice : UDINT; (*Devicename given as a pointer*)
|
||||
pFile : UDINT; (*Filename given as a pointer*)
|
||||
pParam : UDINT; (*Parameterstring given as a pointer*)
|
||||
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
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SdmSetAppParam (*SDM - set application mode; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
appMode : UDINT; (*cfgSDM_APPMODE_OK(1),cfgSDM_APPMODE_WARNING(2),cfgSDM_APPMODE_ERROR(3)*)
|
||||
pLink : UDINT; (*URL given as a pointer*)
|
||||
Option : UDINT; (*options: cfgOPTION_VOLATILE, cfgOPTION_NON_VOLATILE*)
|
||||
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
|
||||
1
Logical/Libraries/AsArSdm/AsArSdm.typ
Normal file
1
Logical/Libraries/AsArSdm/AsArSdm.typ
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
21
Logical/Libraries/AsArSdm/AsArSdm.var
Normal file
21
Logical/Libraries/AsArSdm/AsArSdm.var
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
VAR CONSTANT
|
||||
sdmERR_NOT_EXIST : UINT := 34900; (*SDM not active*)
|
||||
sdmERR_ARREG : UINT := 34901; (*SDM AR registry error*)
|
||||
sdmERR_SYSTEMDUMP : UINT := 34902; (*SDM System dump error*)
|
||||
sdmERR_INVALID_DEVICE : UINT := 34903; (*SDM System dump invalid device*)
|
||||
sdmERR_INVALID_POINTER : UINT := 34904; (*SDM System dump invalid pointer*)
|
||||
sdmERR_INVALID_VALUE : UINT := 34905; (*SDM Invalid application mode*)
|
||||
sdmERR_OPTION_INVALID : UINT := 34906; (*SDM"Option" parameter invalid*)
|
||||
|
||||
sdm_SYSTEMDUMP_PARAM : UINT := 0; (*SDM System Dump parameters only*)
|
||||
sdm_SYSTEMDUMP_DATA : UINT := 1; (*SDM SDM System Dump parameters and data files*)
|
||||
|
||||
sdm_APPMODE_NOTUSED : UINT := 0; (*SDM Applicationmode not set*)
|
||||
sdm_APPMODE_OK : UINT := 1; (*SDM Application ok*)
|
||||
sdm_APPMODE_WARNING : UINT := 2; (*SDM Application warning *)
|
||||
sdm_APPMODE_ERROR : UINT := 3; (*SDM Application error*)
|
||||
|
||||
sdmOPTION_NON_VOLATILE : UDINT := 1; (*permanently sets parameters*)
|
||||
sdmOPTION_VOLATILE : UDINT := 0; (*temporarily sets parameters*)
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsArSdm/Binary.lby
Normal file
12
Logical/Libraries/AsArSdm/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsArSdm library supports the System Diagnostics Manager">
|
||||
<Files>
|
||||
<File>AsArSdm.fun</File>
|
||||
<File>AsArSdm.typ</File>
|
||||
<File>AsArSdm.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
104
Logical/Libraries/AsArSdm/SG4/AsArSdm.h
Normal file
104
Logical/Libraries/AsArSdm/SG4/AsArSdm.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASARSDM_
|
||||
#define _ASARSDM_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define sdmOPTION_VOLATILE 0U
|
||||
#define sdmOPTION_NON_VOLATILE 1U
|
||||
#define sdm_APPMODE_ERROR 3U
|
||||
#define sdm_APPMODE_WARNING 2U
|
||||
#define sdm_APPMODE_OK 1U
|
||||
#define sdm_APPMODE_NOTUSED 0U
|
||||
#define sdm_SYSTEMDUMP_DATA 1U
|
||||
#define sdm_SYSTEMDUMP_PARAM 0U
|
||||
#define sdmERR_OPTION_INVALID 34906U
|
||||
#define sdmERR_INVALID_VALUE 34905U
|
||||
#define sdmERR_INVALID_POINTER 34904U
|
||||
#define sdmERR_INVALID_DEVICE 34903U
|
||||
#define sdmERR_SYSTEMDUMP 34902U
|
||||
#define sdmERR_ARREG 34901U
|
||||
#define sdmERR_NOT_EXIST 34900U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned long sdmOPTION_VOLATILE;
|
||||
_GLOBAL_CONST unsigned long sdmOPTION_NON_VOLATILE;
|
||||
_GLOBAL_CONST unsigned short sdm_APPMODE_ERROR;
|
||||
_GLOBAL_CONST unsigned short sdm_APPMODE_WARNING;
|
||||
_GLOBAL_CONST unsigned short sdm_APPMODE_OK;
|
||||
_GLOBAL_CONST unsigned short sdm_APPMODE_NOTUSED;
|
||||
_GLOBAL_CONST unsigned short sdm_SYSTEMDUMP_DATA;
|
||||
_GLOBAL_CONST unsigned short sdm_SYSTEMDUMP_PARAM;
|
||||
_GLOBAL_CONST unsigned short sdmERR_OPTION_INVALID;
|
||||
_GLOBAL_CONST unsigned short sdmERR_INVALID_VALUE;
|
||||
_GLOBAL_CONST unsigned short sdmERR_INVALID_POINTER;
|
||||
_GLOBAL_CONST unsigned short sdmERR_INVALID_DEVICE;
|
||||
_GLOBAL_CONST unsigned short sdmERR_SYSTEMDUMP;
|
||||
_GLOBAL_CONST unsigned short sdmERR_ARREG;
|
||||
_GLOBAL_CONST unsigned short sdmERR_NOT_EXIST;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct SdmSystemDump
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long configuration;
|
||||
unsigned long pDevice;
|
||||
unsigned long pFile;
|
||||
unsigned long pParam;
|
||||
/* 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;
|
||||
} SdmSystemDump_typ;
|
||||
|
||||
typedef struct SdmSetAppParam
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long appMode;
|
||||
unsigned long pLink;
|
||||
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;
|
||||
} SdmSetAppParam_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void SdmSystemDump(struct SdmSystemDump* inst);
|
||||
_BUR_PUBLIC void SdmSetAppParam(struct SdmSetAppParam* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASARSDM_ */
|
||||
|
||||
80
Logical/Libraries/AsBrStr/AsBrStr.fun
Normal file
80
Logical/Libraries/AsBrStr/AsBrStr.fun
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
{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
|
||||
|
||||
4
Logical/Libraries/AsBrStr/AsBrStr.typ
Normal file
4
Logical/Libraries/AsBrStr/AsBrStr.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
4
Logical/Libraries/AsBrStr/AsBrStr.var
Normal file
4
Logical/Libraries/AsBrStr/AsBrStr.var
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
9
Logical/Libraries/AsBrStr/Binary.lby
Normal file
9
Logical/Libraries/AsBrStr/Binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsBrStr Library contains FBKs for memory and character string handling.">
|
||||
<Files>
|
||||
<File>AsBrStr.fun</File>
|
||||
<File>AsBrStr.typ</File>
|
||||
<File>AsBrStr.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
39
Logical/Libraries/AsBrStr/SG3/AsBrStr.h
Normal file
39
Logical/Libraries/AsBrStr/SG3/AsBrStr.h
Normal 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_ */
|
||||
|
||||
39
Logical/Libraries/AsBrStr/SG4/AsBrStr.h
Normal file
39
Logical/Libraries/AsBrStr/SG4/AsBrStr.h
Normal 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_ */
|
||||
|
||||
39
Logical/Libraries/AsBrStr/SGC/AsBrStr.h
Normal file
39
Logical/Libraries/AsBrStr/SGC/AsBrStr.h
Normal 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_ */
|
||||
|
||||
71
Logical/Libraries/AsBrWStr/AsBrWStr.fun
Normal file
71
Logical/Libraries/AsBrWStr/AsBrWStr.fun
Normal file
@@ -0,0 +1,71 @@
|
||||
|
||||
{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
|
||||
4
Logical/Libraries/AsBrWStr/AsBrWStr.typ
Normal file
4
Logical/Libraries/AsBrWStr/AsBrWStr.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
5
Logical/Libraries/AsBrWStr/AsBrWStr.var
Normal file
5
Logical/Libraries/AsBrWStr/AsBrWStr.var
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
VAR CONSTANT
|
||||
brwUCtoU8 : USINT := 1; (*instructs the wcsconv function to convert a WC character string into an ANSI string*)
|
||||
brwU8toUC : USINT := 0; (*instructs the wcsconv function to convert an ANSI character string into a WC string*)
|
||||
END_VAR
|
||||
9
Logical/Libraries/AsBrWStr/Binary.lby
Normal file
9
Logical/Libraries/AsBrWStr/Binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsBrWStr library allows 8-bit character strings to be implemented for 16-bit WC (AsBrWStr) strings.">
|
||||
<Files>
|
||||
<File>AsBrWStr.fun</File>
|
||||
<File>AsBrWStr.typ</File>
|
||||
<File>AsBrWStr.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
50
Logical/Libraries/AsBrWStr/SG3/AsBrWStr.h
Normal file
50
Logical/Libraries/AsBrWStr/SG3/AsBrWStr.h
Normal 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_ */
|
||||
|
||||
52
Logical/Libraries/AsBrWStr/SG4/AsBrWStr.h
Normal file
52
Logical/Libraries/AsBrWStr/SG4/AsBrWStr.h
Normal 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_ */
|
||||
|
||||
50
Logical/Libraries/AsBrWStr/SGC/AsBrWStr.h
Normal file
50
Logical/Libraries/AsBrWStr/SGC/AsBrWStr.h
Normal 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_ */
|
||||
|
||||
70
Logical/Libraries/AsIOAcc/AsIOAcc.fun
Normal file
70
Logical/Libraries/AsIOAcc/AsIOAcc.fun
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
{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
|
||||
15
Logical/Libraries/AsIOAcc/AsIOAcc.typ
Normal file
15
Logical/Libraries/AsIOAcc/AsIOAcc.typ
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
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
|
||||
10
Logical/Libraries/AsIOAcc/AsIOAcc.var
Normal file
10
Logical/Libraries/AsIOAcc/AsIOAcc.var
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
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
|
||||
12
Logical/Libraries/AsIOAcc/Binary.lby
Normal file
12
Logical/Libraries/AsIOAcc/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="This library provides read and write access to non-cyclic I/O data points.">
|
||||
<Files>
|
||||
<File>AsIOAcc.fun</File>
|
||||
<File>AsIOAcc.typ</File>
|
||||
<File>AsIOAcc.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
132
Logical/Libraries/AsIOAcc/SG4/AsIOAcc.h
Normal file
132
Logical/Libraries/AsIOAcc/SG4/AsIOAcc.h
Normal 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_ */
|
||||
|
||||
101
Logical/Libraries/AsIOAcc/SGC/AsIOAcc.h
Normal file
101
Logical/Libraries/AsIOAcc/SGC/AsIOAcc.h
Normal 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_ */
|
||||
|
||||
|
||||
1729
Logical/Libraries/AsIecCon/AsIecCon.fun
Normal file
1729
Logical/Libraries/AsIecCon/AsIecCon.fun
Normal file
File diff suppressed because it is too large
Load Diff
4
Logical/Libraries/AsIecCon/AsIecCon.typ
Normal file
4
Logical/Libraries/AsIecCon/AsIecCon.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
4
Logical/Libraries/AsIecCon/AsIecCon.var
Normal file
4
Logical/Libraries/AsIecCon/AsIecCon.var
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsIecCon/Binary.lby
Normal file
12
Logical/Libraries/AsIecCon/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="This library contains function interfaces for IEC 61131-3 conversion functions.">
|
||||
<Files>
|
||||
<File>AsIecCon.fun</File>
|
||||
<File>AsIecCon.typ</File>
|
||||
<File>AsIecCon.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="astime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
49
Logical/Libraries/AsIecCon/SG3/AsIecCon.h
Normal file
49
Logical/Libraries/AsIecCon/SG3/AsIecCon.h
Normal 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_ */
|
||||
|
||||
61
Logical/Libraries/AsIecCon/SG4/AsIecCon.h
Normal file
61
Logical/Libraries/AsIecCon/SG4/AsIecCon.h
Normal 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_ */
|
||||
|
||||
62
Logical/Libraries/AsIecCon/SGC/AsIecCon.h
Normal file
62
Logical/Libraries/AsIecCon/SGC/AsIecCon.h
Normal 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_ */
|
||||
|
||||
303
Logical/Libraries/AsSafety/AsSafety.fun
Normal file
303
Logical/Libraries/AsSafety/AsSafety.fun
Normal file
@@ -0,0 +1,303 @@
|
||||
|
||||
{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
|
||||
568
Logical/Libraries/AsSafety/AsSafety.typ
Normal file
568
Logical/Libraries/AsSafety/AsSafety.typ
Normal file
@@ -0,0 +1,568 @@
|
||||
|
||||
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
|
||||
87
Logical/Libraries/AsSafety/AsSafety.var
Normal file
87
Logical/Libraries/AsSafety/AsSafety.var
Normal file
@@ -0,0 +1,87 @@
|
||||
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
|
||||
16
Logical/Libraries/AsSafety/Binary.lby
Normal file
16
Logical/Libraries/AsSafety/Binary.lby
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsSafety library provides function blocks for the safety system.">
|
||||
<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>
|
||||
1153
Logical/Libraries/AsSafety/SG4/AsSafety.h
Normal file
1153
Logical/Libraries/AsSafety/SG4/AsSafety.h
Normal file
File diff suppressed because it is too large
Load Diff
162
Logical/Libraries/AsTCP/AsTCP.fun
Normal file
162
Logical/Libraries/AsTCP/AsTCP.fun
Normal file
@@ -0,0 +1,162 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TcpOpen (*opens a TCP socket; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pIfAddr : UDINT; (*pointer to the interface address*)
|
||||
port : UINT; (*port number of the socket*)
|
||||
options : UDINT; (*options that can be set during opening*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*identifier for use with TcpServer, TcpClient, TcpSend, TcpRecv, TcpClose and TcpIoctl*)
|
||||
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 TcpOpenSsl (*opens a TCP socket using SSL; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pIfAddr : UDINT; (*pointer to the interface address*)
|
||||
port : UINT; (*port number of the socket*)
|
||||
sslCfgIdent : UDINT; (*identifier of the SSL configuration*)
|
||||
options : UDINT; (*options that can be set during opening*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*identifier for use with TcpServer, TcpClient, TcpSend, TcpRecv, TcpClose and TcpIoctl*)
|
||||
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 TcpServer (*starts a TCP server; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
backlog : UDINT; (*number of connections to queue*)
|
||||
pIpAddr : UDINT; (*pointer where to store the ip address of the connected client*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
identclnt : UDINT; (*identifier for use with fub TcpClose, TcpSend, and TcpRecv*)
|
||||
portclnt : UINT; (*port number of connected client*)
|
||||
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 TcpClient (*establishs a connection to a TCP server; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
pServer : UDINT; (*pointer to the ip address of server to connect to*)
|
||||
portserv : UINT; (*port number of server to connect to*)
|
||||
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
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TcpClose (*closes a TCP socket and frees up all required resources; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
how : UDINT; (*shutdown behavior*)
|
||||
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
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TcpSend (*sends data (byte stream); asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
pData : UDINT; (*pointer to the data to be sent*)
|
||||
datalen : UDINT; (*length of byte stream*)
|
||||
flags : UDINT; (*send flags (e.g. "out of band" data)*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
sentlen : UDINT; (*number of actually sent bytes*)
|
||||
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 TcpRecv (*receives TCP byte stream; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
pData : UDINT; (*pointer to the buffer where to store byte stream data*)
|
||||
datamax : UDINT; (*max. length of data in bytes*)
|
||||
flags : UDINT; (*receive flags*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
recvlen : UDINT; (*length of the bytes received*)
|
||||
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 TcpIoctl (*changes or retrieves settings; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier returned from TcpOpen()*)
|
||||
ioctl : UDINT; (*I/O control code*)
|
||||
pData : UDINT; (*pointer to the I/O control data buffer*)
|
||||
datalen : UDINT; (*lentgh of I/O control input data*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
outlen : UDINT; (*output data length*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
12
Logical/Libraries/AsTCP/AsTCP.typ
Normal file
12
Logical/Libraries/AsTCP/AsTCP.typ
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
TYPE
|
||||
tcpLINGER_typ : STRUCT (*linger*)
|
||||
lOnOff : UDINT; (*linger on/off*)
|
||||
lLinger : UDINT; (*linger time (seconds)*)
|
||||
END_STRUCT;
|
||||
|
||||
tcpSO_ADDRESS_typ : STRUCT (*socket address*)
|
||||
pPort : UDINT; (*pointer where to store the portnumber*)
|
||||
pIpAddr : UDINT; (*pointer where to store the socket ip address*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
62
Logical/Libraries/AsTCP/AsTCP.var
Normal file
62
Logical/Libraries/AsTCP/AsTCP.var
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
VAR CONSTANT
|
||||
tcpERR_INVALID_IDENT : UINT := 32600; (*invalid ident*)
|
||||
tcpERR_NOMORE_IDENTS : UINT := 32601; (*no more idents*)
|
||||
tcpERR_ALREADY_EXIST : UINT := 32602; (*socket already exists*)
|
||||
tcpERR_PARAMETER : UINT := 32603; (*invalid parameter, check parameter*)
|
||||
tcpERR_INVALID_IOCTL : UINT := 32604; (*io control not supported*)
|
||||
tcpERR_NO_DATA : UINT := 32605; (*no data to receive*)
|
||||
tcpERR_SENTLEN : UINT := 32606; (*length sent error, call again*)
|
||||
tcpERR_WOULDBLOCK : UINT := 32607; (*would block, call again*)
|
||||
tcpERR_INVALID : UINT := 32608; (*invalid argument*)
|
||||
tcpERR_NOT_CONNECTED : UINT := 32609; (*socket is not connected*)
|
||||
tcpERR_ALREADY_CONNECTED : UINT := 32610; (*connected has been already established*)
|
||||
tcpERR_NO_OOBDATA : UINT := 32611; (*no out of band data*)
|
||||
tcpERR_INTERFACE : UINT := 32612; (*illegal interface*)
|
||||
tcpERR_NOCLIENT : UINT := 32613; (*client not yet connected*)
|
||||
|
||||
tcpERR_SOCKET_CREATE : UINT := 32650; (*create socket failed*)
|
||||
tcpERR_SOCKET_BIND : UINT := 32651; (*bind socket failed*)
|
||||
tcpERR_SOCKET_LISTEN : UINT := 32652; (*listen socket failed*)
|
||||
tcpERR_SOCKET_ACCEPT : UINT := 32653; (*accept socket failed*)
|
||||
|
||||
tcpERR_INVALID_SSL_CONFIG : UINT := 32697; (*invalid SSL configuration given*)
|
||||
tcpERR_SSL_HANDSHAKE_FAILED : UINT := 32698; (*SSL handshake failed*)
|
||||
|
||||
tcpERR_SYSTEM : UINT := 32699; (*system error*)
|
||||
|
||||
tcpSO_LINGER_SET : UDINT := 1001; (*set option linger*)
|
||||
tcpSO_LINGER_GET : UDINT := 1002; (*get option linger*)
|
||||
tcpSO_KEEPALIVE_SET : UDINT := 1003; (*set option keep alive*)
|
||||
tcpSO_KEEPALIVE_GET : UDINT := 1004; (*get option keep alive*)
|
||||
tcpSO_SNDBUF_SET : UDINT := 1005; (*set option send buffer*)
|
||||
tcpSO_SNDBUF_GET : UDINT := 1006; (*get option send buffer*)
|
||||
tcpSO_RCVBUF_SET : UDINT := 1007; (*set option receive buffer*)
|
||||
tcpSO_RCVBUF_GET : UDINT := 1008; (*get option receive buffer*)
|
||||
tcpSO_OOBINLINE_SET : UDINT := 1009; (*set option out of band data inline*)
|
||||
tcpSO_OOBINLINE_GET : UDINT := 1010; (*get option out of band data inline*)
|
||||
tcpSO_ADDRESS_GET : UDINT := 1011; (*get socket address*)
|
||||
tcpSO_NOWAITING_SET : UDINT := 1012; (*set option no waiting until client connects*)
|
||||
tcpSO_NOWAITING_GET : UDINT := 1013; (*get option no waiting until client connects*)
|
||||
tcpTCP_NODELAY_SET : UDINT := 2001; (*set option tcp no delay*)
|
||||
tcpTCP_NODELAY_GET : UDINT := 2002; (*get option tcp no delay*)
|
||||
tcpTCP_KEEPCNT_SET : UDINT := 2003; (*set option tcp keep count*)
|
||||
tcpTCP_KEEPCNT_GET : UDINT := 2004; (*get option tcp keep count*)
|
||||
tcpTCP_KEEPIDLE_SET : UDINT := 2005; (*set option tcp keep idle*)
|
||||
tcpTCP_KEEPIDLE_GET : UDINT := 2006; (*get option tcp keep idle*)
|
||||
tcpTCP_KEEPINTVL_SET : UDINT := 2007; (*set option tcp keep intervall*)
|
||||
tcpTCP_KEEPINTVL_GET : UDINT := 2008; (*get option tcp keep intervall*)
|
||||
tcpID_LIST_GET : UDINT := 3001; (*get ident list*)
|
||||
tcpID_MAX_GET : UDINT := 3002; (*get max ident count*)
|
||||
|
||||
tcpMSG_OOB : UDINT := 1; (*out of band message*)
|
||||
tcpMSG_PEEK : UDINT := 2; (*don't remove data from socket (receive)*)
|
||||
tcpMSG_DONTROUTE : UDINT := 4; (*message don't route (send)*)
|
||||
|
||||
tcpOPT_REUSEADDR : UDINT := 1; (*option reuse address*)
|
||||
|
||||
tcpSHUT_RD : UDINT := 1; (*shutdown read channel*)
|
||||
tcpSHUT_WR : UDINT := 2; (*shutdown write channel*)
|
||||
|
||||
tcpINVALID_IDENT : UDINT := 0; (*invalid ident*)
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsTCP/Binary.lby
Normal file
12
Logical/Libraries/AsTCP/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="This library contains FBKs for exchanging data (data stream) via stream sockets (TCP).">
|
||||
<Files>
|
||||
<File>AsTCP.fun</File>
|
||||
<File>AsTCP.typ</File>
|
||||
<File>AsTCP.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
261
Logical/Libraries/AsTCP/SG3/AsTCP.h
Normal file
261
Logical/Libraries/AsTCP/SG3/AsTCP.h
Normal file
@@ -0,0 +1,261 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTCP_
|
||||
#define _ASTCP_
|
||||
#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 tcpINVALID_IDENT 0U
|
||||
#define tcpSHUT_WR 2U
|
||||
#define tcpSHUT_RD 1U
|
||||
#define tcpOPT_REUSEADDR 1U
|
||||
#define tcpMSG_DONTROUTE 4U
|
||||
#define tcpMSG_PEEK 2U
|
||||
#define tcpMSG_OOB 1U
|
||||
#define tcpID_MAX_GET 3002U
|
||||
#define tcpID_LIST_GET 3001U
|
||||
#define tcpTCP_NODELAY_GET 2002U
|
||||
#define tcpTCP_NODELAY_SET 2001U
|
||||
#define tcpSO_NOWAITING_GET 1013U
|
||||
#define tcpSO_NOWAITING_SET 1012U
|
||||
#define tcpSO_ADDRESS_GET 1011U
|
||||
#define tcpSO_OOBINLINE_GET 1010U
|
||||
#define tcpSO_OOBINLINE_SET 1009U
|
||||
#define tcpSO_RCVBUF_GET 1008U
|
||||
#define tcpSO_RCVBUF_SET 1007U
|
||||
#define tcpSO_SNDBUF_GET 1006U
|
||||
#define tcpSO_SNDBUF_SET 1005U
|
||||
#define tcpSO_KEEPALIVE_GET 1004U
|
||||
#define tcpSO_KEEPALIVE_SET 1003U
|
||||
#define tcpSO_LINGER_GET 1002U
|
||||
#define tcpSO_LINGER_SET 1001U
|
||||
#define tcpERR_SYSTEM 32699U
|
||||
#define tcpERR_SOCKET_ACCEPT 32653U
|
||||
#define tcpERR_SOCKET_LISTEN 32652U
|
||||
#define tcpERR_SOCKET_BIND 32651U
|
||||
#define tcpERR_SOCKET_CREATE 32650U
|
||||
#define tcpERR_NOCLIENT 32613U
|
||||
#define tcpERR_INTERFACE 32612U
|
||||
#define tcpERR_NO_OOBDATA 32611U
|
||||
#define tcpERR_ALREADY_CONNECTED 32610U
|
||||
#define tcpERR_NOT_CONNECTED 32609U
|
||||
#define tcpERR_INVALID 32608U
|
||||
#define tcpERR_WOULDBLOCK 32607U
|
||||
#define tcpERR_SENTLEN 32606U
|
||||
#define tcpERR_NO_DATA 32605U
|
||||
#define tcpERR_INVALID_IOCTL 32604U
|
||||
#define tcpERR_PARAMETER 32603U
|
||||
#define tcpERR_ALREADY_EXIST 32602U
|
||||
#define tcpERR_NOMORE_IDENTS 32601U
|
||||
#define tcpERR_INVALID_IDENT 32600U
|
||||
#else
|
||||
_IEC_CONST unsigned long tcpINVALID_IDENT = 0U;
|
||||
_IEC_CONST unsigned long tcpSHUT_WR = 2U;
|
||||
_IEC_CONST unsigned long tcpSHUT_RD = 1U;
|
||||
_IEC_CONST unsigned long tcpOPT_REUSEADDR = 1U;
|
||||
_IEC_CONST unsigned long tcpMSG_DONTROUTE = 4U;
|
||||
_IEC_CONST unsigned long tcpMSG_PEEK = 2U;
|
||||
_IEC_CONST unsigned long tcpMSG_OOB = 1U;
|
||||
_IEC_CONST unsigned long tcpID_MAX_GET = 3002U;
|
||||
_IEC_CONST unsigned long tcpID_LIST_GET = 3001U;
|
||||
_IEC_CONST unsigned long tcpTCP_NODELAY_GET = 2002U;
|
||||
_IEC_CONST unsigned long tcpTCP_NODELAY_SET = 2001U;
|
||||
_IEC_CONST unsigned long tcpSO_NOWAITING_GET = 1013U;
|
||||
_IEC_CONST unsigned long tcpSO_NOWAITING_SET = 1012U;
|
||||
_IEC_CONST unsigned long tcpSO_ADDRESS_GET = 1011U;
|
||||
_IEC_CONST unsigned long tcpSO_OOBINLINE_GET = 1010U;
|
||||
_IEC_CONST unsigned long tcpSO_OOBINLINE_SET = 1009U;
|
||||
_IEC_CONST unsigned long tcpSO_RCVBUF_GET = 1008U;
|
||||
_IEC_CONST unsigned long tcpSO_RCVBUF_SET = 1007U;
|
||||
_IEC_CONST unsigned long tcpSO_SNDBUF_GET = 1006U;
|
||||
_IEC_CONST unsigned long tcpSO_SNDBUF_SET = 1005U;
|
||||
_IEC_CONST unsigned long tcpSO_KEEPALIVE_GET = 1004U;
|
||||
_IEC_CONST unsigned long tcpSO_KEEPALIVE_SET = 1003U;
|
||||
_IEC_CONST unsigned long tcpSO_LINGER_GET = 1002U;
|
||||
_IEC_CONST unsigned long tcpSO_LINGER_SET = 1001U;
|
||||
_IEC_CONST unsigned short tcpERR_SYSTEM = 32699U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_ACCEPT = 32653U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_LISTEN = 32652U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_BIND = 32651U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_CREATE = 32650U;
|
||||
_IEC_CONST unsigned short tcpERR_NOCLIENT = 32613U;
|
||||
_IEC_CONST unsigned short tcpERR_INTERFACE = 32612U;
|
||||
_IEC_CONST unsigned short tcpERR_NO_OOBDATA = 32611U;
|
||||
_IEC_CONST unsigned short tcpERR_ALREADY_CONNECTED = 32610U;
|
||||
_IEC_CONST unsigned short tcpERR_NOT_CONNECTED = 32609U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID = 32608U;
|
||||
_IEC_CONST unsigned short tcpERR_WOULDBLOCK = 32607U;
|
||||
_IEC_CONST unsigned short tcpERR_SENTLEN = 32606U;
|
||||
_IEC_CONST unsigned short tcpERR_NO_DATA = 32605U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID_IOCTL = 32604U;
|
||||
_IEC_CONST unsigned short tcpERR_PARAMETER = 32603U;
|
||||
_IEC_CONST unsigned short tcpERR_ALREADY_EXIST = 32602U;
|
||||
_IEC_CONST unsigned short tcpERR_NOMORE_IDENTS = 32601U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID_IDENT = 32600U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct tcpLINGER_typ
|
||||
{ unsigned long lOnOff;
|
||||
unsigned long lLinger;
|
||||
} tcpLINGER_typ;
|
||||
|
||||
typedef struct tcpSO_ADDRESS_typ
|
||||
{ unsigned long pPort;
|
||||
unsigned long pIpAddr;
|
||||
} tcpSO_ADDRESS_typ;
|
||||
|
||||
typedef struct TcpOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pIfAddr;
|
||||
unsigned short port;
|
||||
unsigned long options;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpOpen_typ;
|
||||
|
||||
typedef struct TcpServer
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long backlog;
|
||||
unsigned long pIpAddr;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identclnt;
|
||||
unsigned short portclnt;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpServer_typ;
|
||||
|
||||
typedef struct TcpClient
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pServer;
|
||||
unsigned short portserv;
|
||||
/* 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;
|
||||
} TcpClient_typ;
|
||||
|
||||
typedef struct TcpClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long how;
|
||||
/* 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;
|
||||
} TcpClose_typ;
|
||||
|
||||
typedef struct TcpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long sentlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpSend_typ;
|
||||
|
||||
typedef struct TcpRecv
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datamax;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long recvlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpRecv_typ;
|
||||
|
||||
typedef struct TcpIoctl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long ioctl;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpIoctl_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void TcpOpen(struct TcpOpen* inst);
|
||||
void TcpServer(struct TcpServer* inst);
|
||||
void TcpClient(struct TcpClient* inst);
|
||||
void TcpClose(struct TcpClose* inst);
|
||||
void TcpSend(struct TcpSend* inst);
|
||||
void TcpRecv(struct TcpRecv* inst);
|
||||
void TcpIoctl(struct TcpIoctl* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTCP_ */
|
||||
|
||||
|
||||
297
Logical/Libraries/AsTCP/SG4/AsTCP.h
Normal file
297
Logical/Libraries/AsTCP/SG4/AsTCP.h
Normal file
@@ -0,0 +1,297 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTCP_
|
||||
#define _ASTCP_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define tcpINVALID_IDENT 0U
|
||||
#define tcpSHUT_WR 2U
|
||||
#define tcpSHUT_RD 1U
|
||||
#define tcpOPT_REUSEADDR 1U
|
||||
#define tcpMSG_DONTROUTE 4U
|
||||
#define tcpMSG_PEEK 2U
|
||||
#define tcpMSG_OOB 1U
|
||||
#define tcpID_MAX_GET 3002U
|
||||
#define tcpID_LIST_GET 3001U
|
||||
#define tcpTCP_KEEPINTVL_GET 2008U
|
||||
#define tcpTCP_KEEPINTVL_SET 2007U
|
||||
#define tcpTCP_KEEPIDLE_GET 2006U
|
||||
#define tcpTCP_KEEPIDLE_SET 2005U
|
||||
#define tcpTCP_KEEPCNT_GET 2004U
|
||||
#define tcpTCP_KEEPCNT_SET 2003U
|
||||
#define tcpTCP_NODELAY_GET 2002U
|
||||
#define tcpTCP_NODELAY_SET 2001U
|
||||
#define tcpSO_NOWAITING_GET 1013U
|
||||
#define tcpSO_NOWAITING_SET 1012U
|
||||
#define tcpSO_ADDRESS_GET 1011U
|
||||
#define tcpSO_OOBINLINE_GET 1010U
|
||||
#define tcpSO_OOBINLINE_SET 1009U
|
||||
#define tcpSO_RCVBUF_GET 1008U
|
||||
#define tcpSO_RCVBUF_SET 1007U
|
||||
#define tcpSO_SNDBUF_GET 1006U
|
||||
#define tcpSO_SNDBUF_SET 1005U
|
||||
#define tcpSO_KEEPALIVE_GET 1004U
|
||||
#define tcpSO_KEEPALIVE_SET 1003U
|
||||
#define tcpSO_LINGER_GET 1002U
|
||||
#define tcpSO_LINGER_SET 1001U
|
||||
#define tcpERR_SYSTEM 32699U
|
||||
#define tcpERR_SSL_HANDSHAKE_FAILED 32698U
|
||||
#define tcpERR_INVALID_SSL_CONFIG 32697U
|
||||
#define tcpERR_SOCKET_ACCEPT 32653U
|
||||
#define tcpERR_SOCKET_LISTEN 32652U
|
||||
#define tcpERR_SOCKET_BIND 32651U
|
||||
#define tcpERR_SOCKET_CREATE 32650U
|
||||
#define tcpERR_NOCLIENT 32613U
|
||||
#define tcpERR_INTERFACE 32612U
|
||||
#define tcpERR_NO_OOBDATA 32611U
|
||||
#define tcpERR_ALREADY_CONNECTED 32610U
|
||||
#define tcpERR_NOT_CONNECTED 32609U
|
||||
#define tcpERR_INVALID 32608U
|
||||
#define tcpERR_WOULDBLOCK 32607U
|
||||
#define tcpERR_SENTLEN 32606U
|
||||
#define tcpERR_NO_DATA 32605U
|
||||
#define tcpERR_INVALID_IOCTL 32604U
|
||||
#define tcpERR_PARAMETER 32603U
|
||||
#define tcpERR_ALREADY_EXIST 32602U
|
||||
#define tcpERR_NOMORE_IDENTS 32601U
|
||||
#define tcpERR_INVALID_IDENT 32600U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned long tcpINVALID_IDENT;
|
||||
_GLOBAL_CONST unsigned long tcpSHUT_WR;
|
||||
_GLOBAL_CONST unsigned long tcpSHUT_RD;
|
||||
_GLOBAL_CONST unsigned long tcpOPT_REUSEADDR;
|
||||
_GLOBAL_CONST unsigned long tcpMSG_DONTROUTE;
|
||||
_GLOBAL_CONST unsigned long tcpMSG_PEEK;
|
||||
_GLOBAL_CONST unsigned long tcpMSG_OOB;
|
||||
_GLOBAL_CONST unsigned long tcpID_MAX_GET;
|
||||
_GLOBAL_CONST unsigned long tcpID_LIST_GET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPINTVL_GET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPINTVL_SET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPIDLE_GET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPIDLE_SET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPCNT_GET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_KEEPCNT_SET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_NODELAY_GET;
|
||||
_GLOBAL_CONST unsigned long tcpTCP_NODELAY_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_NOWAITING_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_NOWAITING_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_ADDRESS_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_OOBINLINE_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_OOBINLINE_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_RCVBUF_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_RCVBUF_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_SNDBUF_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_SNDBUF_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_KEEPALIVE_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_KEEPALIVE_SET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_LINGER_GET;
|
||||
_GLOBAL_CONST unsigned long tcpSO_LINGER_SET;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SYSTEM;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SSL_HANDSHAKE_FAILED;
|
||||
_GLOBAL_CONST unsigned short tcpERR_INVALID_SSL_CONFIG;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SOCKET_ACCEPT;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SOCKET_LISTEN;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SOCKET_BIND;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SOCKET_CREATE;
|
||||
_GLOBAL_CONST unsigned short tcpERR_NOCLIENT;
|
||||
_GLOBAL_CONST unsigned short tcpERR_INTERFACE;
|
||||
_GLOBAL_CONST unsigned short tcpERR_NO_OOBDATA;
|
||||
_GLOBAL_CONST unsigned short tcpERR_ALREADY_CONNECTED;
|
||||
_GLOBAL_CONST unsigned short tcpERR_NOT_CONNECTED;
|
||||
_GLOBAL_CONST unsigned short tcpERR_INVALID;
|
||||
_GLOBAL_CONST unsigned short tcpERR_WOULDBLOCK;
|
||||
_GLOBAL_CONST unsigned short tcpERR_SENTLEN;
|
||||
_GLOBAL_CONST unsigned short tcpERR_NO_DATA;
|
||||
_GLOBAL_CONST unsigned short tcpERR_INVALID_IOCTL;
|
||||
_GLOBAL_CONST unsigned short tcpERR_PARAMETER;
|
||||
_GLOBAL_CONST unsigned short tcpERR_ALREADY_EXIST;
|
||||
_GLOBAL_CONST unsigned short tcpERR_NOMORE_IDENTS;
|
||||
_GLOBAL_CONST unsigned short tcpERR_INVALID_IDENT;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct tcpLINGER_typ
|
||||
{ unsigned long lOnOff;
|
||||
unsigned long lLinger;
|
||||
} tcpLINGER_typ;
|
||||
|
||||
typedef struct tcpSO_ADDRESS_typ
|
||||
{ unsigned long pPort;
|
||||
unsigned long pIpAddr;
|
||||
} tcpSO_ADDRESS_typ;
|
||||
|
||||
typedef struct TcpOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pIfAddr;
|
||||
unsigned short port;
|
||||
unsigned long options;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpOpen_typ;
|
||||
|
||||
typedef struct TcpOpenSsl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pIfAddr;
|
||||
unsigned short port;
|
||||
unsigned long sslCfgIdent;
|
||||
unsigned long options;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpOpenSsl_typ;
|
||||
|
||||
typedef struct TcpServer
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long backlog;
|
||||
unsigned long pIpAddr;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identclnt;
|
||||
unsigned short portclnt;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpServer_typ;
|
||||
|
||||
typedef struct TcpClient
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pServer;
|
||||
unsigned short portserv;
|
||||
/* 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;
|
||||
} TcpClient_typ;
|
||||
|
||||
typedef struct TcpClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long how;
|
||||
/* 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;
|
||||
} TcpClose_typ;
|
||||
|
||||
typedef struct TcpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long sentlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpSend_typ;
|
||||
|
||||
typedef struct TcpRecv
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datamax;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long recvlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpRecv_typ;
|
||||
|
||||
typedef struct TcpIoctl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long ioctl;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpIoctl_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void TcpOpen(struct TcpOpen* inst);
|
||||
_BUR_PUBLIC void TcpOpenSsl(struct TcpOpenSsl* inst);
|
||||
_BUR_PUBLIC void TcpServer(struct TcpServer* inst);
|
||||
_BUR_PUBLIC void TcpClient(struct TcpClient* inst);
|
||||
_BUR_PUBLIC void TcpClose(struct TcpClose* inst);
|
||||
_BUR_PUBLIC void TcpSend(struct TcpSend* inst);
|
||||
_BUR_PUBLIC void TcpRecv(struct TcpRecv* inst);
|
||||
_BUR_PUBLIC void TcpIoctl(struct TcpIoctl* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTCP_ */
|
||||
|
||||
261
Logical/Libraries/AsTCP/SGC/AsTCP.h
Normal file
261
Logical/Libraries/AsTCP/SGC/AsTCP.h
Normal file
@@ -0,0 +1,261 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTCP_
|
||||
#define _ASTCP_
|
||||
#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 tcpINVALID_IDENT 0U
|
||||
#define tcpSHUT_WR 2U
|
||||
#define tcpSHUT_RD 1U
|
||||
#define tcpOPT_REUSEADDR 1U
|
||||
#define tcpMSG_DONTROUTE 4U
|
||||
#define tcpMSG_PEEK 2U
|
||||
#define tcpMSG_OOB 1U
|
||||
#define tcpID_MAX_GET 3002U
|
||||
#define tcpID_LIST_GET 3001U
|
||||
#define tcpTCP_NODELAY_GET 2002U
|
||||
#define tcpTCP_NODELAY_SET 2001U
|
||||
#define tcpSO_NOWAITING_GET 1013U
|
||||
#define tcpSO_NOWAITING_SET 1012U
|
||||
#define tcpSO_ADDRESS_GET 1011U
|
||||
#define tcpSO_OOBINLINE_GET 1010U
|
||||
#define tcpSO_OOBINLINE_SET 1009U
|
||||
#define tcpSO_RCVBUF_GET 1008U
|
||||
#define tcpSO_RCVBUF_SET 1007U
|
||||
#define tcpSO_SNDBUF_GET 1006U
|
||||
#define tcpSO_SNDBUF_SET 1005U
|
||||
#define tcpSO_KEEPALIVE_GET 1004U
|
||||
#define tcpSO_KEEPALIVE_SET 1003U
|
||||
#define tcpSO_LINGER_GET 1002U
|
||||
#define tcpSO_LINGER_SET 1001U
|
||||
#define tcpERR_SYSTEM 32699U
|
||||
#define tcpERR_SOCKET_ACCEPT 32653U
|
||||
#define tcpERR_SOCKET_LISTEN 32652U
|
||||
#define tcpERR_SOCKET_BIND 32651U
|
||||
#define tcpERR_SOCKET_CREATE 32650U
|
||||
#define tcpERR_NOCLIENT 32613U
|
||||
#define tcpERR_INTERFACE 32612U
|
||||
#define tcpERR_NO_OOBDATA 32611U
|
||||
#define tcpERR_ALREADY_CONNECTED 32610U
|
||||
#define tcpERR_NOT_CONNECTED 32609U
|
||||
#define tcpERR_INVALID 32608U
|
||||
#define tcpERR_WOULDBLOCK 32607U
|
||||
#define tcpERR_SENTLEN 32606U
|
||||
#define tcpERR_NO_DATA 32605U
|
||||
#define tcpERR_INVALID_IOCTL 32604U
|
||||
#define tcpERR_PARAMETER 32603U
|
||||
#define tcpERR_ALREADY_EXIST 32602U
|
||||
#define tcpERR_NOMORE_IDENTS 32601U
|
||||
#define tcpERR_INVALID_IDENT 32600U
|
||||
#else
|
||||
_IEC_CONST unsigned long tcpINVALID_IDENT = 0U;
|
||||
_IEC_CONST unsigned long tcpSHUT_WR = 2U;
|
||||
_IEC_CONST unsigned long tcpSHUT_RD = 1U;
|
||||
_IEC_CONST unsigned long tcpOPT_REUSEADDR = 1U;
|
||||
_IEC_CONST unsigned long tcpMSG_DONTROUTE = 4U;
|
||||
_IEC_CONST unsigned long tcpMSG_PEEK = 2U;
|
||||
_IEC_CONST unsigned long tcpMSG_OOB = 1U;
|
||||
_IEC_CONST unsigned long tcpID_MAX_GET = 3002U;
|
||||
_IEC_CONST unsigned long tcpID_LIST_GET = 3001U;
|
||||
_IEC_CONST unsigned long tcpTCP_NODELAY_GET = 2002U;
|
||||
_IEC_CONST unsigned long tcpTCP_NODELAY_SET = 2001U;
|
||||
_IEC_CONST unsigned long tcpSO_NOWAITING_GET = 1013U;
|
||||
_IEC_CONST unsigned long tcpSO_NOWAITING_SET = 1012U;
|
||||
_IEC_CONST unsigned long tcpSO_ADDRESS_GET = 1011U;
|
||||
_IEC_CONST unsigned long tcpSO_OOBINLINE_GET = 1010U;
|
||||
_IEC_CONST unsigned long tcpSO_OOBINLINE_SET = 1009U;
|
||||
_IEC_CONST unsigned long tcpSO_RCVBUF_GET = 1008U;
|
||||
_IEC_CONST unsigned long tcpSO_RCVBUF_SET = 1007U;
|
||||
_IEC_CONST unsigned long tcpSO_SNDBUF_GET = 1006U;
|
||||
_IEC_CONST unsigned long tcpSO_SNDBUF_SET = 1005U;
|
||||
_IEC_CONST unsigned long tcpSO_KEEPALIVE_GET = 1004U;
|
||||
_IEC_CONST unsigned long tcpSO_KEEPALIVE_SET = 1003U;
|
||||
_IEC_CONST unsigned long tcpSO_LINGER_GET = 1002U;
|
||||
_IEC_CONST unsigned long tcpSO_LINGER_SET = 1001U;
|
||||
_IEC_CONST unsigned short tcpERR_SYSTEM = 32699U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_ACCEPT = 32653U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_LISTEN = 32652U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_BIND = 32651U;
|
||||
_IEC_CONST unsigned short tcpERR_SOCKET_CREATE = 32650U;
|
||||
_IEC_CONST unsigned short tcpERR_NOCLIENT = 32613U;
|
||||
_IEC_CONST unsigned short tcpERR_INTERFACE = 32612U;
|
||||
_IEC_CONST unsigned short tcpERR_NO_OOBDATA = 32611U;
|
||||
_IEC_CONST unsigned short tcpERR_ALREADY_CONNECTED = 32610U;
|
||||
_IEC_CONST unsigned short tcpERR_NOT_CONNECTED = 32609U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID = 32608U;
|
||||
_IEC_CONST unsigned short tcpERR_WOULDBLOCK = 32607U;
|
||||
_IEC_CONST unsigned short tcpERR_SENTLEN = 32606U;
|
||||
_IEC_CONST unsigned short tcpERR_NO_DATA = 32605U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID_IOCTL = 32604U;
|
||||
_IEC_CONST unsigned short tcpERR_PARAMETER = 32603U;
|
||||
_IEC_CONST unsigned short tcpERR_ALREADY_EXIST = 32602U;
|
||||
_IEC_CONST unsigned short tcpERR_NOMORE_IDENTS = 32601U;
|
||||
_IEC_CONST unsigned short tcpERR_INVALID_IDENT = 32600U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct tcpLINGER_typ
|
||||
{ unsigned long lOnOff;
|
||||
unsigned long lLinger;
|
||||
} tcpLINGER_typ;
|
||||
|
||||
typedef struct tcpSO_ADDRESS_typ
|
||||
{ unsigned long pPort;
|
||||
unsigned long pIpAddr;
|
||||
} tcpSO_ADDRESS_typ;
|
||||
|
||||
typedef struct TcpOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pIfAddr;
|
||||
unsigned short port;
|
||||
unsigned long options;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpOpen_typ;
|
||||
|
||||
typedef struct TcpServer
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long backlog;
|
||||
unsigned long pIpAddr;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identclnt;
|
||||
unsigned short portclnt;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpServer_typ;
|
||||
|
||||
typedef struct TcpClient
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pServer;
|
||||
unsigned short portserv;
|
||||
/* 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;
|
||||
} TcpClient_typ;
|
||||
|
||||
typedef struct TcpClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long how;
|
||||
/* 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;
|
||||
} TcpClose_typ;
|
||||
|
||||
typedef struct TcpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long sentlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpSend_typ;
|
||||
|
||||
typedef struct TcpRecv
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long datamax;
|
||||
unsigned long flags;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long recvlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpRecv_typ;
|
||||
|
||||
typedef struct TcpIoctl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long ioctl;
|
||||
unsigned long pData;
|
||||
unsigned long datalen;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outlen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TcpIoctl_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void TcpOpen(struct TcpOpen* inst);
|
||||
void TcpServer(struct TcpServer* inst);
|
||||
void TcpClient(struct TcpClient* inst);
|
||||
void TcpClose(struct TcpClose* inst);
|
||||
void TcpSend(struct TcpSend* inst);
|
||||
void TcpRecv(struct TcpRecv* inst);
|
||||
void TcpIoctl(struct TcpIoctl* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTCP_ */
|
||||
|
||||
|
||||
75
Logical/Libraries/AsUSB/AsUSB.fun
Normal file
75
Logical/Libraries/AsUSB/AsUSB.fun
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UsbNodeListGet (* get USB node list *)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (* fub enable *)
|
||||
pBuffer : UDINT; (* pointer to input buffer *)
|
||||
bufferSize : UDINT; (* max length of input buffer *)
|
||||
filterInterfaceClass : UINT; (* filter for interface class *)
|
||||
filterInterfaceSubClass : UINT; (* filter for interface subclass *)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status : UINT; (* status *)
|
||||
allNodes : UDINT; (* all usb nodes on target *)
|
||||
listNodes : UDINT; (* usb nodes in the list *)
|
||||
attachDetachCount:UDINT; (* attach/deatch actions *)
|
||||
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 UsbNodeGet (* get USB node description *)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (* fub enable *)
|
||||
nodeId : UDINT; (* unique node identifier of USBNodeListGet *)
|
||||
pBuffer : UDINT; (* pointer to input buffer *)
|
||||
bufferSize : UDINT; (* max length of input buffer *)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status : UINT; (* status *)
|
||||
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 UsbDescriptorGet (* get USB node descriptor *)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (* fub enable *)
|
||||
nodeId : UDINT; (* unique node identifier of USBNodeListGet *)
|
||||
requestType : USINT; (* reqeust type *)
|
||||
descriptorType : USINT; (* descriptor type *)
|
||||
descriptorIndex : USINT; (* descriptor index *)
|
||||
languageId : UINT; (* language unicode *)
|
||||
pBuffer : UDINT; (* pointer to input buffer *)
|
||||
bufferSize : UINT; (* max length of input buffer *)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status : UINT; (* status *)
|
||||
actSize : UINT; (* length of received data *)
|
||||
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 UsbMsDeviceReady (* get USB mass storage device ready status *)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (* fub enable *)
|
||||
pIfName : UDINT; (* pointer to string of ifName of input buffer of USBNodeGet *)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status : UINT; (* status *)
|
||||
ready : BOOL; (* device ready status true/false *)
|
||||
END_VAR
|
||||
VAR
|
||||
i_state : UINT; (* internal variable *)
|
||||
i_result : UINT; (* internal variable *)
|
||||
i_tmp : UDINT; (* internal variable *)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
|
||||
79
Logical/Libraries/AsUSB/AsUSB.typ
Normal file
79
Logical/Libraries/AsUSB/AsUSB.typ
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
TYPE
|
||||
usbNode_typ : STRUCT (* statistics *)
|
||||
interfaceClass : UINT; (* Interface Class des USB Ger<65>tes *)
|
||||
interfaceSubClass : UINT; (* Interface SubClass des USB Ger<65>tes *)
|
||||
interfaceProtocol : UINT; (* Interface Protocol des USB Ger<65>tes *)
|
||||
vendorId : UINT; (* Device Vendor ID *)
|
||||
productId : UINT; (* Device Product ID *)
|
||||
bcdDevice : UINT; (* USB device release version binary coded decimal *)
|
||||
ifName : STRING[127]; (* USB IF Name *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
TYPE
|
||||
usbDeviceDescr_typ : STRUCT (* statistics *)
|
||||
length : USINT; (* bLength *)
|
||||
descriptorType : USINT; (* bDescriptorType *)
|
||||
bcdUsb : UINT; (* bcdUSB - USB release in BCD *)
|
||||
deviceClass : USINT; (* bDeviceClass *)
|
||||
deviceSubClass : USINT; (* bDeviceSubClass *)
|
||||
deviceProtocol : USINT; (* bDeviceProtocol *)
|
||||
maxPacketSize0 : USINT; (* bMaxPacketSize0 *)
|
||||
vendor : UINT; (* idVendor *)
|
||||
product : UINT; (* idProduct *)
|
||||
bcdDevice : UINT; (* bcdDevice - dev release in BCD *)
|
||||
manufacturerIndex : USINT; (* iManufacturer *)
|
||||
productIndex : USINT; (* iProduct *)
|
||||
serialNumberIndex : USINT; (* iSerialNumber *)
|
||||
numConfigurations : USINT; (* bNumConfigurations *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
TYPE
|
||||
usbConfigDescr_typ : STRUCT (* statistics *)
|
||||
bLength : USINT; (* Size of this descriptor in bytes *)
|
||||
bDescriptorType : USINT; (* CONFIGURATION Descriptor Type *)
|
||||
wTotalLength : UINT; (* Configuration data length *)
|
||||
bNumInterfaces : USINT; (* Number of interfaces supported *)
|
||||
bConfigurationValue : USINT; (* SetConfiguration() function argument *)
|
||||
iConfiguration : USINT; (* Configuration string descriptor *)
|
||||
bmAttributes : USINT; (* Bitmap configuration characteristics *)
|
||||
MaxPower : USINT; (* Max pwr consumption (mA) of operational device on bus *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
TYPE
|
||||
usbStringDescr_typ : STRUCT (* statistics *)
|
||||
length : USINT; (* bLength *)
|
||||
descriptorType : USINT; (* bDescriptorType *)
|
||||
string : STRING[1]; (* bString - variable len *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
TYPE
|
||||
usbInterfaceDescr_typ : STRUCT (* statistics *)
|
||||
bLength : USINT; (* Size of this descriptor in bytes *)
|
||||
bDescriptorType : USINT; (* Interface Descriptor Type *)
|
||||
bInterfaceNumber : USINT; (* Zero-based interface number *)
|
||||
bAlternateSetting : USINT; (* Alternate setting for interface *)
|
||||
bNumEndpoints : USINT; (* Num of endpoints (excluding endpoint zero) *)
|
||||
bInterfaceClass : USINT; (* Class code of this interface *)
|
||||
bInterfaceSubClass : USINT; (* Subclass code of this interface *)
|
||||
bInterfaceProtocol : USINT; (* Interface protocol code *)
|
||||
iInterface : USINT; (* Interface string descriptor *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
TYPE
|
||||
usbEndpointDescr_typ : STRUCT (* statistics *)
|
||||
bLength : USINT; (* Descriptor length in bytes *)
|
||||
bDescriptorType : USINT; (* Endpoint Descriptor type *)
|
||||
bEndpointAddress : USINT; (* Endpoint address on the USB device *)
|
||||
bmAttributes : USINT; (* Endpoint transfer, sych & usage types attr *)
|
||||
wMaxPacketSize : UINT; (* Endpoint max packet size *)
|
||||
bInterval : USINT; (* Polling interval for endpoint data xfer *)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user