Workbackup
This commit is contained in:
12
KD_Pliessnigg_Reinraum.apj
Normal file
12
KD_Pliessnigg_Reinraum.apj
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version="4.11.3.51 SP" WorkingVersion="4.11"?>
|
||||
<Project Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
|
||||
<Communication>
|
||||
<OnlineConfiguration Name="KD_Reinraum" DeviceType="TCPIP" DeviceParameters="/IF=tcpip /LOPO=11159 /SA=1" ConnectionParameters="/COMT=2500 /RT=1000 /AM=* /SDT=5 /DAIP=192.168.0.230 /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" />
|
||||
</Project>
|
||||
7
LastUser.set
Normal file
7
LastUser.set
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version="4.11.3.51 SP"?>
|
||||
<ProjectSettings xmlns="http://br-automation.co.at/AS/ProjectSettings">
|
||||
<ConfigurationManager ActiveConfigurationName="Config2" />
|
||||
<Deployment Value="ActiveCpu" />
|
||||
<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 FileVersion="4.9"?>
|
||||
<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="Logdatei erstellen">ProcLog</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
411
Logical/Common/ProcLog/Cyclic.st
Normal file
411
Logical/Common/ProcLog/Cyclic.st
Normal file
@@ -0,0 +1,411 @@
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
|
||||
//Trigger generiren
|
||||
IF EDGEPOS (gDTstrucCurrentTime.second = 0) THEN
|
||||
bLogData := TRUE;
|
||||
IF bTestSendMail OR ((gDTstrucCurrentTime.hour = 0) AND
|
||||
(gDTstrucCurrentTime.minute = 0)) THEN
|
||||
//Tageswechsel
|
||||
brsstrcpy (ADR (gMailCmd.sLogfileName), ADR (strFile));
|
||||
gMailCmd.bSendLogfile := TRUE;
|
||||
bTestSendMail := FALSE;
|
||||
END_IF
|
||||
brsitoa (gDTstrucCurrentTime.year, ADR (strTempNum[2]));
|
||||
brsstrcpy (ADR (strFile), ADR (strTempNum[2]));
|
||||
IF (gDTstrucCurrentTime.month < 10) THEN
|
||||
brsstrcat (ADR (strFile), ADR ('0'));
|
||||
END_IF
|
||||
brsitoa (gDTstrucCurrentTime.month, ADR (strTempNum[2]));
|
||||
brsstrcat (ADR (strFile), ADR (strTempNum[2]));
|
||||
IF (gDTstrucCurrentTime.day < 10) THEN
|
||||
brsstrcat (ADR (strFile), ADR ('0'));
|
||||
END_IF
|
||||
brsitoa (gDTstrucCurrentTime.day, ADR (strTempNum[2]));
|
||||
brsstrcat (ADR (strFile), ADR (strTempNum[2]));
|
||||
brsstrcat (ADR (strFile), ADR ('.csv'));
|
||||
END_IF
|
||||
|
||||
|
||||
|
||||
//Logdateischreiben
|
||||
//############################################
|
||||
CASE enLogfile OF
|
||||
//Auf Befehl warten
|
||||
//==========================================
|
||||
enLogWAIT:
|
||||
IF bLogData AND (brsstrlen (ADR (gsCurrentTime)) > 1) THEN
|
||||
//Dateinamen festlegen
|
||||
//Log Vorbereiten
|
||||
brsmemset (ADR (strLine), 0, SIZEOF (strLine));
|
||||
brsstrcpy (ADR (strLine), ADR ('$n'));
|
||||
brsstrcat (ADR (strLine), ADR (gsCurrentTime));
|
||||
brsstrcat (ADR (strLine), ADR (';'));
|
||||
brsitoa (gLogValue.iParticle25, ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (';'));
|
||||
brsitoa (gLogValue.iParticle10, ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (';'));
|
||||
brsitoa (gLimits.iParticle25, ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (';'));
|
||||
brsitoa (gLimits.iParticle10, ADR (strTempNum[1]));
|
||||
brsstrcat (ADR (strLine), ADR (strTempNum[1]));
|
||||
enLogfile := enLogCREATE;
|
||||
END_IF
|
||||
|
||||
//Auf Befehl warten
|
||||
//==========================================
|
||||
enLogCREATE:
|
||||
FUBs.FileCreate.pDevice := ADR (strLocDevice);
|
||||
FUBs.FileCreate.pFile := ADR (strFile);
|
||||
FUBs.FileCreate.enable := TRUE;
|
||||
|
||||
IF (FUBs.FileCreate.status = ERR_OK) THEN
|
||||
udLogfileOffset := 0;
|
||||
udLogfileIdent := FUBs.FileCreate.ident;
|
||||
enLogfile := enLogWRITEHEADER;
|
||||
ELSIF (FUBs.FileCreate.status = fiERR_EXIST) THEN
|
||||
//An Vorhandene Datei anh<EFBFBD>ngen
|
||||
enLogfile := enLogOPEN;
|
||||
ELSIF (FUBs.FileOpen.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
enLogfile := enLogWAIT;
|
||||
END_IF
|
||||
|
||||
//Datei <EFBFBD>ffnen
|
||||
//==========================================
|
||||
enLogOPEN:
|
||||
FUBs.FileOpen.pDevice := ADR (strLocDevice);
|
||||
FUBs.FileOpen.mode := fiREAD_WRITE;
|
||||
FUBs.FileOpen.pFile := ADR (strFile);
|
||||
FUBs.FileOpen.enable := TRUE;
|
||||
|
||||
IF (FUBs.FileOpen.status = ERR_OK) THEN
|
||||
FUBs.FileOpen.enable := FALSE;
|
||||
udLogfileIdent := FUBs.FileOpen.ident;
|
||||
udLogfileOffset := FUBs.FileOpen.filelen;
|
||||
IF (udLogfileOffset = 0) THEN
|
||||
//Bei Neuer Datei erstmal Header erstellen
|
||||
enLogfile := enLogWRITEHEADER;
|
||||
ELSE
|
||||
enLogfile := enLogWRITE;
|
||||
END_IF
|
||||
ELSIF (FUBs.FileOpen.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
//20700 fiERR_INVALID_PATH Ung<EFBFBD>ltiger Pfad. Pfad ist ist zu lang, leer oder NULL
|
||||
//20702 fiERR_NO_MORE_ENTRIES Keine File-Handle mehr vorhanden. Besetzte File-Handle freigeben (Files schlie<EFBFBD>en).
|
||||
//20706 fiERR_ACCESS Es wurde versucht auf die Datei in einem Mode zuzugreifen, welcher f<EFBFBD>r die Datei nicht erlaubt bzw. m<EFBFBD>glich ist. <EFBFBD>berpr<EFBFBD>fen, ob der angegebene Mode f<EFBFBD>r die angegebene Datei korrekt ist.
|
||||
//20708 fiERR_FILE_NOT_FOUND File nicht vorhanden. File-Name pr<EFBFBD>fen.
|
||||
//20709 fiERR_FILE_DEVICE pDevice ist zu lang oder NULL
|
||||
//20718 fiERR_COM_FILE_IOCTL Fehler beim Ermitteln der File-L<EFBFBD>nge. Die L<EFBFBD>nge des Files <EFBFBD>berschreitet den maximalen Wert eines UDINTs.
|
||||
//20798 fiERR_DEVICE_MANAGER Fehler im DeviceManager (z.B.: Filedevice nicht initialisiert "CPU->Eigenschaften->File Devices")
|
||||
enLogfile := enLogCLOSE;
|
||||
END_IF
|
||||
|
||||
//Header schreiben bei neuen Dateien
|
||||
//==========================================
|
||||
enLogWRITEHEADER:
|
||||
FUBs.FileWrite.ident := udLogfileIdent;
|
||||
strHeader := 'TS;Part25;Part10;Part25Lim;Part10Lim';
|
||||
usLastParamset := 250;
|
||||
FUBs.FileWrite.len := brsstrlen (ADR (strHeader));
|
||||
FUBs.FileWrite.offset := udLogfileOffset;
|
||||
FUBs.FileWrite.pSrc := ADR (strHeader);
|
||||
FUBs.FileWrite.enable := TRUE;
|
||||
|
||||
IF (FUBs.FileWrite.status = ERR_OK) THEN
|
||||
FUBs.FileWrite.enable := FALSE; //Wg Pos Flanke
|
||||
udLogfileOffset := udLogfileOffset + FUBs.FileWrite.len;
|
||||
enLogfile := enLogWRITE;
|
||||
ELSIF (FUBs.FileWrite.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
//20706 fiERR_ACCESS Zugriff mit gew<EFBFBD>nschten Mode nicht m<EFBFBD>glich. Zugriffsmode <EFBFBD>ndern.
|
||||
//20710 fiERR_SPACE Zuwenig Speicher. Datenl<EFBFBD>nge pr<EFBFBD>fen.
|
||||
//20711 fiERR_SEEK Ung<EFBFBD>ltiger File-Offset. Offset pr<EFBFBD>fen.
|
||||
//20717 fiERR_COM_FILE_WRITE Allgemeiner Fehler aus FileWrite. AR-interner Fehler, f<EFBFBD>r den kein Fehlerbehebungsvorschlag angegeben werden kann.
|
||||
//20718 fiERR_COM_FILE_IOCTL Allgemeiner Fehler aus Ioctl. AR-interner Fehler, f<EFBFBD>r den kein Fehlerbehebungsvorschlag angegeben werden kann.
|
||||
//20719 fiERR_DATA Der angegebene Datenpointer (pSrc) ist ung<EFBFBD>ltig. Datenpointer pr<EFBFBD>fen (NULL-Pointer).
|
||||
//20721 fiERR_FILE_NOT_OPENED File nicht ge<EFBFBD>ffnet. File-Handle pr<EFBFBD>fen.
|
||||
//20798 fiERR_DEVICE_MANAGER Fehler im DeviceManager (z.B.: Filedevice nicht initialisiert "CPU->Eigenschaften->File Devices")
|
||||
enLogfile := enLogCLOSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Datei schreiben
|
||||
//==========================================
|
||||
enLogWRITE:
|
||||
FUBs.FileWrite.ident := udLogfileIdent;
|
||||
FUBs.FileWrite.len := brsstrlen (ADR (strLine));
|
||||
FUBs.FileWrite.offset := udLogfileOffset;
|
||||
FUBs.FileWrite.pSrc := ADR (strLine);
|
||||
FUBs.FileWrite.enable := TRUE;
|
||||
|
||||
|
||||
IF (FUBs.FileWrite.status = ERR_OK) THEN
|
||||
udLogfileOffset := udLogfileOffset + FUBs.FileWrite.len;
|
||||
enLogfile := enLogCLOSE;
|
||||
ELSIF (FUBs.FileWrite.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
//20706 fiERR_ACCESS Zugriff mit gew<EFBFBD>nschten Mode nicht m<EFBFBD>glich. Zugriffsmode <EFBFBD>ndern.
|
||||
//20710 fiERR_SPACE Zuwenig Speicher. Datenl<EFBFBD>nge pr<EFBFBD>fen.
|
||||
//20711 fiERR_SEEK Ung<EFBFBD>ltiger File-Offset. Offset pr<EFBFBD>fen.
|
||||
//20717 fiERR_COM_FILE_WRITE Allgemeiner Fehler aus FileWrite. AR-interner Fehler, f<EFBFBD>r den kein Fehlerbehebungsvorschlag angegeben werden kann.
|
||||
//20718 fiERR_COM_FILE_IOCTL Allgemeiner Fehler aus Ioctl. AR-interner Fehler, f<EFBFBD>r den kein Fehlerbehebungsvorschlag angegeben werden kann.
|
||||
//20719 fiERR_DATA Der angegebene Datenpointer (pSrc) ist ung<EFBFBD>ltig. Datenpointer pr<EFBFBD>fen (NULL-Pointer).
|
||||
//20721 fiERR_FILE_NOT_OPENED File nicht ge<EFBFBD>ffnet. File-Handle pr<EFBFBD>fen.
|
||||
//20798 fiERR_DEVICE_MANAGER Fehler im DeviceManager (z.B.: Filedevice nicht initialisiert "CPU->Eigenschaften->File Devices")
|
||||
enLogfile := enLogCLOSE;
|
||||
END_IF
|
||||
|
||||
//Datei schlie<EFBFBD>en
|
||||
//==========================================
|
||||
enLogCLOSE:
|
||||
FUBs.FileClose.ident := udLogfileIdent;
|
||||
FUBs.FileClose.enable := TRUE;
|
||||
|
||||
IF (FUBs.FileClose.status = ERR_OK) THEN
|
||||
bLogData := FALSE;
|
||||
enLogfile := enLogWAIT;
|
||||
ELSIF (FUBs.FileClose.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
//20715 fiERR_COM_FILE_CLOSE Allgemeiner Fehler aus FileClose. AR-interner Fehler, f<EFBFBD>r den kein Fehlerbehebungsvorschlag angegeben werden kann.
|
||||
//20721 fiERR_FILE_NOT_OPENED File nicht ge<EFBFBD>ffnet. File-Handle pr<EFBFBD>fen.
|
||||
//20798 fiERR_DEVICE_MANAGER Fehler im DeviceManager (z.B.: Filedevice nicht initialisiert "CPU->Eigenschaften->File Devices")
|
||||
bLogData := FALSE;
|
||||
enLogfile := enLogWAIT;
|
||||
END_IF
|
||||
|
||||
END_CASE
|
||||
|
||||
//Logdatei auf USB Stick koppieren
|
||||
//############################################
|
||||
|
||||
CASE enCopyLogfile OF
|
||||
//Auf Befehl warten
|
||||
//==========================================
|
||||
enCpLogWAIT:
|
||||
IF EDGEPOS (VCButtons.CopyLogFile.bCommand) THEN
|
||||
VCStates.CopyState := enStateACTIVE;
|
||||
enCopyLogfile := enCpLogNodeListGet;
|
||||
END_IF
|
||||
|
||||
//NodeList auslesen
|
||||
//==========================================
|
||||
enCpLogNodeListGet:
|
||||
FUBs.UsbNodeListGet.enable := TRUE;
|
||||
FUBs.UsbNodeListGet.pBuffer := ADR (udNodeList);
|
||||
FUBs.UsbNodeListGet.bufferSize := 8;
|
||||
FUBs.UsbNodeListGet.filterInterfaceClass := asusb_CLASS_MASS_STORAGE;
|
||||
FUBs.UsbNodeListGet.filterInterfaceSubClass := asusb_SUBCLASS_SCSI_COMMAND_SET;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF (FUBs.UsbNodeListGet.status = ERR_OK) THEN
|
||||
//Ok
|
||||
IF FUBs.UsbNodeListGet.listNodes = 0 THEN
|
||||
//Kein USB Stick gefunden
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
ELSE
|
||||
//Min 1 Stick gefunden
|
||||
//Kein USB Stick gefunden
|
||||
enCopyLogfile := enCpLogNodeGet;
|
||||
END_IF
|
||||
ELSIF (FUBs.UsbNodeListGet.status = asusbERR_USB_NOTFOUND) THEN
|
||||
//Kein USB Stick gefunden
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
|
||||
ELSIF (FUBs.UsbNodeListGet.status = asusbERR_BUFSIZE) OR
|
||||
(FUBs.UsbNodeListGet.status = asusbERR_NULLPOINTER) THEN
|
||||
//Buffer error
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
END_IF
|
||||
|
||||
//GetNode
|
||||
//==========================================
|
||||
enCpLogNodeGet:
|
||||
FUBs.UsbNodeGet.nodeId := udNodeList[0]; //Erstes Ger<EFBFBD>t nehmen
|
||||
FUBs.UsbNodeGet.pBuffer := ADR (usbNodeInfo);
|
||||
FUBs.UsbNodeGet.bufferSize := SIZEOF (usbNodeInfo);
|
||||
FUBs.UsbNodeGet.enable := TRUE;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF FUBs.UsbNodeGet.status = ERR_OK THEN
|
||||
//Ok
|
||||
strDevLinkParam := '/DEVICE=';
|
||||
brsstrcat (ADR (strDevLinkParam), ADR (usbNodeInfo.ifName));
|
||||
enCopyLogfile := enCPLogDevLink;
|
||||
ELSIF FUBs.UsbNodeGet.status = asusbERR_USB_NOTFOUND THEN
|
||||
//Kein USB Stick gefunden
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
|
||||
ELSIF (FUBs.UsbNodeGet.status = asusbERR_BUFSIZE) OR
|
||||
(FUBs.UsbNodeGet.status = asusbERR_NULLPOINTER) THEN
|
||||
//Buffer error
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
END_IF
|
||||
|
||||
|
||||
//GetDescriptor
|
||||
//==========================================
|
||||
enCPLogDevLink:
|
||||
FUBs.DevLink.pDevice := ADR (strUSBDevice);
|
||||
FUBs.DevLink.pParam := ADR (strDevLinkParam);
|
||||
FUBs.DevLink.enable := TRUE;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF FUBs.DevLink.status = ERR_OK THEN
|
||||
//Ok
|
||||
FUBs.DevUnlink.handle := FUBs.DevLink.handle;
|
||||
enCopyLogfile := enCpLogBackupFile;
|
||||
ELSIF (FUBs.DevLink.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
|
||||
(*
|
||||
20709 fiERR_FILE_DEVICE File-Device nicht zul<EFBFBD>ssig (z. B.: nicht initialisiert "CPU->Eigenschaften->File Devices"); Dieser Fehler wird ausgegeben, wenn bei ATOM PLCs ein falscher String <EFBFBD>bergeben wird.
|
||||
20729 fiERR_PARAMETER Ung<EFBFBD>ltige Parameterangabe. Pr<EFBFBD>fung der angegebenen Parameter.
|
||||
20730 fiERR_DEVICE_ALREADY_EXIST Device existiert bereits. Anderen Device-Namen w<EFBFBD>hlen.
|
||||
20732 fiERR_NETIO_IP_UNEQUAL F<EFBFBD>r einen Hostnamen ist bereits eine andere IP-Adresse definiert worden, bzw. der DNS-Server liefert eine andere IP-Adresse. IP-Adresse korrigieren oder /IPOW=TRUE im Device Parameter setzen, um die bereits vorhandene abweichende IP-Adresse mit der im Device Parameter definierten zu <EFBFBD>berschreiben.
|
||||
20736 fiERR_NETIO_PARAMETERS Ung<EFBFBD>ltige Parameter beim Herstellen einer Verbindung angegeben. Kontrolliere auf Konflikte beim Hostnamen. <EFBFBD>berpr<EFBFBD>fe Servername und/oder IP Adresse.
|
||||
20799 fiERR_SYSTEM System Fehler,
|
||||
allgemeine Fehler aus dem System (genauere Information kann mit der Funktion FileIOGetSysError() ausgelesen werden.
|
||||
*)
|
||||
|
||||
END_IF
|
||||
|
||||
//Datei Sichern
|
||||
//==========================================
|
||||
enCpLogBackupFile:
|
||||
FUBs.FileCopy.pSrcDev := ADR (strLocDevice);
|
||||
FUBs.FileCopy.pSrc := ADR ('Logfile.csv');
|
||||
FUBs.FileCopy.pDestDev := ADR (strLocDevice);
|
||||
FUBs.FileCopy.pDest := ADR ('Logfile.sav');
|
||||
FUBs.FileCopy.option := fiOVERWRITE;
|
||||
FUBs.FileCopy.enable := TRUE;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF (FUBs.FileCopy.status = ERR_OK) THEN
|
||||
FUBs.FileCopy.enable := FALSE; //Wg. Flanke
|
||||
enCopyLogfile := enCpLogCopyFile;
|
||||
ELSIF (FUBs.FileCopy.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCPLogDevUnLink;
|
||||
END_IF
|
||||
|
||||
//Datei kopieren
|
||||
//==========================================
|
||||
enCpLogCopyFile:
|
||||
FUBs.FileCopy.pSrcDev := ADR (strLocDevice);
|
||||
FUBs.FileCopy.pSrc := ADR ('Logfile.csv');
|
||||
FUBs.FileCopy.pDestDev := ADR (strUSBDevice);
|
||||
FUBs.FileCopy.pDest := ADR ('Logfile.csv');
|
||||
FUBs.FileCopy.option := fiOVERWRITE;
|
||||
FUBs.FileCopy.enable := TRUE;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF (FUBs.FileCopy.status = ERR_OK) THEN
|
||||
enCopyLogfile := enCpLogDeleteFile;
|
||||
ELSIF (FUBs.FileCopy.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCPLogDevUnLink;
|
||||
END_IF
|
||||
|
||||
//Datei l<EFBFBD>schen
|
||||
//==========================================
|
||||
enCpLogDeleteFile:
|
||||
FUBs.FileDelete.pDevice := FUBs.FileCopy.pSrcDev;
|
||||
FUBs.FileDelete.pName := FUBs.FileCopy.pSrc;
|
||||
FUBs.FileDelete.enable := TRUE;
|
||||
|
||||
enCopyLogfileDebug := enCopyLogfile;
|
||||
IF (FUBs.FileDelete.status = ERR_OK) THEN
|
||||
VCStates.CopyState := enStateOK;
|
||||
enCopyLogfile := enCPLogDevUnLink;
|
||||
ELSIF (FUBs.FileDelete.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
VCStates.CopyState := enStateNOK;
|
||||
enCopyLogfile := enCPLogDevUnLink;
|
||||
END_IF
|
||||
|
||||
//Laufwerk trennen
|
||||
//==========================================
|
||||
enCPLogDevUnLink:
|
||||
FUBs.DevUnlink.enable := TRUE;
|
||||
|
||||
IF (FUBs.DevUnlink.status = ERR_OK) THEN
|
||||
FUBs.DevUnlink.enable := FALSE;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
ELSIF (FUBs.DevUnlink.status < ERR_FUB_ENABLE_FALSE) THEN
|
||||
FUBs.DevUnlink.enable := FALSE;
|
||||
enCopyLogfile := enCpLogWAIT;
|
||||
END_IF
|
||||
|
||||
END_CASE
|
||||
|
||||
|
||||
// IF gVCCommands.bErrorReset THEN
|
||||
// MpAlarmReset (gMpBasicAlarmMachine, 10);
|
||||
// MpAlarmReset (gMpBasicAlarmMachine, 11);
|
||||
// END_IF
|
||||
|
||||
FUBs.FileCreate ();
|
||||
IF (enLogfile <> enLogCREATE) THEN
|
||||
FUBs.FileCreate.enable := FALSE;
|
||||
END_IF
|
||||
|
||||
FUBs.FileOpen ();
|
||||
IF (enLogfile <> enLogOPEN) THEN
|
||||
FUBs.FileOpen.enable := FALSE;
|
||||
END_IF
|
||||
|
||||
FUBs.FileClose ();
|
||||
IF (enLogfile <> enLogCLOSE) THEN
|
||||
FUBs.FileClose.enable := FALSE;
|
||||
END_IF
|
||||
|
||||
FUBs.FileWrite ();
|
||||
IF (enLogfile <> enLogWRITEHEADER) AND
|
||||
(enLogfile <> enLogWRITE) THEN
|
||||
FUBs.FileWrite.enable := FALSE;
|
||||
END_IF
|
||||
|
||||
FUBs.TON_CopyIdle.IN := (enCopyLogfile = enCpLogWAIT) AND (VCStates.CopyState <> enStateIDLE);
|
||||
FUBs.TON_CopyIdle.PT := t#5s;
|
||||
FUBs.TON_CopyIdle ();
|
||||
|
||||
IF FUBs.TON_CopyIdle.Q THEN
|
||||
VCStates.CopyState := enStateIDLE;
|
||||
END_IF
|
||||
|
||||
IF (enCopyLogfile <> enCpLogNodeListGet) THEN
|
||||
FUBs.UsbNodeListGet.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.UsbNodeListGet ();
|
||||
|
||||
IF (enCopyLogfile <> enCpLogNodeGet) THEN
|
||||
FUBs.UsbNodeGet.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.UsbNodeGet ();
|
||||
|
||||
IF (enCopyLogfile <> enCPLogDevLink) THEN
|
||||
FUBs.DevLink.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.DevLink ();
|
||||
|
||||
IF (enCopyLogfile <> enCpLogBackupFile) AND
|
||||
(enCopyLogfile <> enCpLogCopyFile) THEN
|
||||
FUBs.FileCopy.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.FileCopy ();
|
||||
|
||||
IF (enCopyLogfile <> enCpLogDeleteFile) THEN
|
||||
FUBs.FileDelete.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.FileDelete ();
|
||||
|
||||
IF (enCopyLogfile <> enCPLogDevUnLink) THEN
|
||||
FUBs.DevUnlink.enable := FALSE;
|
||||
END_IF
|
||||
FUBs.DevUnlink ();
|
||||
|
||||
END_PROGRAM
|
||||
6
Logical/Common/ProcLog/Exit.st
Normal file
6
Logical/Common/ProcLog/Exit.st
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
PROGRAM _EXIT
|
||||
(* Insert code here *)
|
||||
|
||||
END_PROGRAM
|
||||
11
Logical/Common/ProcLog/IEC.prg
Normal file
11
Logical/Common/ProcLog/IEC.prg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Program SubType="IEC" xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Cyclic code">Cyclic.st</File>
|
||||
<File Description="Init code">Init.st</File>
|
||||
<File Description="Exit code">Exit.st</File>
|
||||
<File Description="Local data types" Private="true">Types.typ</File>
|
||||
<File Description="Local variables" Private="true">Variables.var</File>
|
||||
</Files>
|
||||
</Program>
|
||||
6
Logical/Common/ProcLog/Init.st
Normal file
6
Logical/Common/ProcLog/Init.st
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
PROGRAM _INIT
|
||||
strLocDevice := 'DATALOG';
|
||||
strDevLinkParam := 'STICK';
|
||||
END_PROGRAM
|
||||
68
Logical/Common/ProcLog/Types.typ
Normal file
68
Logical/Common/ProcLog/Types.typ
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
TYPE
|
||||
typ_FUB : STRUCT (*Funktionsbausteine*)
|
||||
TON_CopyIdle : TON;
|
||||
FileCreate : FileCreate; (*Datei erstellen*)
|
||||
FileOpen : FileOpen; (*Datei <20>ffnen*)
|
||||
FileClose : FileClose; (*Datei schlie<69>en*)
|
||||
FileWrite : FileWrite; (*In Datei Schreiben*)
|
||||
FileCopy : FileCopy;
|
||||
FileDelete : FileDelete;
|
||||
UsbNodeListGet : UsbNodeListGet;
|
||||
UsbNodeGet : UsbNodeGet; (*Device (Netzlaufwerk) linken*)
|
||||
DevLink : DevLink;
|
||||
DevUnlink : DevUnlink;
|
||||
END_STRUCT;
|
||||
typ_enLogfile :
|
||||
(
|
||||
enLogWAIT := 0, (*Auf Befehl Warten*)
|
||||
enLogCREATE, (*Datei erstellen*)
|
||||
enLogOPEN, (*Datei <20>ffnen*)
|
||||
enLogWRITEHEADER, (*Header schreiben*)
|
||||
enLogWRITE, (*Datei schreiben*)
|
||||
enLogCLOSE (*Datei schlie<69>en*)
|
||||
);
|
||||
typ_enCopyLogfile :
|
||||
(
|
||||
enCpLogWAIT := 0, (*Auf Befehl warten*)
|
||||
enCpLogNodeListGet,
|
||||
enCpLogNodeGet,
|
||||
enCPLogDevLink,
|
||||
enCpLogCopyFile, (*File Kopieren*)
|
||||
enCpLogBackupFile, (*File Kopieren*)
|
||||
enCpLogDeleteFile, (*File L<>schen*)
|
||||
enCPLogDevUnLink
|
||||
);
|
||||
typ_AlarmIDs : STRUCT (*Puffer f<>r Alarm IDs*)
|
||||
udLogFileCreate : UDINT;
|
||||
udLogFileOpen : UDINT;
|
||||
udLogFileWriteHeader : UDINT;
|
||||
udLogFileWrite : UDINT;
|
||||
udLogFileClose : UDINT;
|
||||
udCpLogNoUSBDev : UDINT;
|
||||
udCpLogBufferError : UDINT;
|
||||
udCpLogDevLink : UDINT;
|
||||
udCpLogFileBackup : UDINT;
|
||||
udCpLogFileCopy : UDINT;
|
||||
udCpLogFileDelete : UDINT;
|
||||
udCpLogDevUnLink : UDINT;
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
(*//Visual Components*)
|
||||
|
||||
TYPE
|
||||
typ_VCButtons : STRUCT
|
||||
CopyLogFile : gtyp_VCButton; (*Logfile auf USB kopieren*)
|
||||
END_STRUCT;
|
||||
typ_VCStates : STRUCT
|
||||
CopyState : typ_EnState; (*Logfile auf USB kopieren*)
|
||||
END_STRUCT;
|
||||
typ_EnState :
|
||||
(
|
||||
enStateIDLE := 0, (*Grau*)
|
||||
enStateACTIVE := 1, (*Gelb*)
|
||||
enStateOK := 2, (*Gruen*)
|
||||
enStateNOK := 3 (*ROT*)
|
||||
);
|
||||
END_TYPE
|
||||
38
Logical/Common/ProcLog/Variables.var
Normal file
38
Logical/Common/ProcLog/Variables.var
Normal file
@@ -0,0 +1,38 @@
|
||||
VAR
|
||||
bLogData : BOOL;
|
||||
bTestSendMail : BOOL;
|
||||
usLastParamset : USINT;
|
||||
udLogfileOffset : UDINT;
|
||||
udLogfileIdent : UDINT;
|
||||
udTest : UDINT;
|
||||
udNodeList : ARRAY[0..7] OF UDINT;
|
||||
rTempNum : ARRAY[1..7] OF REAL;
|
||||
strTempFrac : ARRAY[1..7] OF STRING[80];
|
||||
strTempNum : ARRAY[1..7] OF STRING[80];
|
||||
strLocDevice : STRING[80];
|
||||
strUSBDevice : STRING[80];
|
||||
strDevLinkParam : STRING[80];
|
||||
strFile : STRING[40];
|
||||
strHeader : STRING[256];
|
||||
strLine : STRING[256];
|
||||
strTemp : STRING[40];
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
uiCRLF : UINT := 16#0D0A;
|
||||
END_VAR
|
||||
VAR
|
||||
LogData : {REDUND_UNREPLICABLE} gtyp_Environment;
|
||||
usbNodeInfo : usbNode_typ;
|
||||
enLogfile : typ_enLogfile; (*Logfile erstellen*)
|
||||
enCopyLogfile : typ_enCopyLogfile; (*Logfile auf USB Stick kopieren*)
|
||||
enCopyLogfileDebug : typ_enCopyLogfile; (*Debug*)
|
||||
END_VAR
|
||||
(*//Funktionsbl<62>cke*)
|
||||
VAR
|
||||
FUBs : typ_FUB;
|
||||
END_VAR
|
||||
(*//Strukturen*)
|
||||
VAR
|
||||
VCButtons : typ_VCButtons;
|
||||
VCStates : typ_VCStates;
|
||||
END_VAR
|
||||
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 FileVersion="4.9"?>
|
||||
<Program SubType="IEC" 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>
|
||||
10
Logical/Common/get_dt/get_dt.var
Normal file
10
Logical/Common/get_dt/get_dt.var
Normal file
@@ -0,0 +1,10 @@
|
||||
VAR
|
||||
sTemp : STRING[10] := '';
|
||||
lDTStructureGetTime : DTStructureGetTime := (0);
|
||||
lDTGetTime : DTGetTime := (0);
|
||||
lDTStructureSetTime : DTStructureSetTime := (0);
|
||||
lTimeStructure : TIMEStructure := (0);
|
||||
lDTSetTime : DTStructure;
|
||||
bUpdate : BOOL;
|
||||
bSetDate : BOOL;
|
||||
END_VAR
|
||||
83
Logical/Common/get_dt/get_dtCyclic.ab
Normal file
83
Logical/Common/get_dt/get_dtCyclic.ab
Normal file
@@ -0,0 +1,83 @@
|
||||
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)
|
||||
//yyy-mm-dd hh:mm:ss.000
|
||||
brsstrcpy (ADR (gsCurrentTime), "")
|
||||
brsitoa (gDTstrucCurrentTime.year, ADR (sTemp))
|
||||
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
|
||||
brsstrcat (ADR (gsCurrentTime), "-")
|
||||
IF (gDTstrucCurrentTime.month < 10) THEN
|
||||
brsstrcat (ADR (gsCurrentTime), "0")
|
||||
ENDIF
|
||||
brsitoa (gDTstrucCurrentTime.month, ADR (sTemp))
|
||||
brsstrcat (ADR (gsCurrentTime), ADR (sTemp))
|
||||
brsstrcat (ADR (gsCurrentTime), "-")
|
||||
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), ".")
|
||||
IF (gDTstrucCurrentTime.millisec < 10) THEN
|
||||
brsstrcat (ADR (gsCurrentTime), "00")
|
||||
ELSE IF (gDTstrucCurrentTime.millisec < 100) THEN
|
||||
brsstrcat (ADR (gsCurrentTime), "0")
|
||||
ENDIF
|
||||
|
||||
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))
|
||||
|
||||
//Set Date
|
||||
IF bUpdate THEN
|
||||
lDTSetTime = gDTstrucCurrentTime
|
||||
bUpdate = FALSE
|
||||
ENDIF
|
||||
|
||||
lDTStructureSetTime.pDTStructure = ADR (lDTSetTime)
|
||||
lDTStructureSetTime.enable = bSetDate
|
||||
lDTStructureSetTime FUB DTStructureSetTime ()
|
||||
|
||||
IF (lDTStructureSetTime.status <> ERR_FUB_ENABLE_FALSE) AND (lDTStructureSetTime.status <> ERR_FUB_BUSY) THEN
|
||||
bSetDate = FALSE
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
4
Logical/Global.typ
Normal file
4
Logical/Global.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
8
Logical/Global.var
Normal file
8
Logical/Global.var
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
VAR
|
||||
|
||||
END_VAR
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
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
|
||||
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_ */
|
||||
|
||||
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 FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The AsBrStr Library contains FBKs for memory and character string handling." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsBrStr.fun</File>
|
||||
<File>AsBrStr.typ</File>
|
||||
<File>AsBrStr.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
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
|
||||
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_ */
|
||||
|
||||
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 FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains function interfaces for IEC 61131-3 conversion functions." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsIecCon.fun</File>
|
||||
<File>AsIecCon.typ</File>
|
||||
<File>AsIecCon.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="astime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
58
Logical/Libraries/AsSMTP/AsSMTP.fun
Normal file
58
Logical/Libraries/AsSMTP/AsSMTP.fun
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SmtpSend (*sends email; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pHost : UDINT; (*pointer to the ip address of mail server*)
|
||||
pUser : UDINT; (*pointer to the user name for authentication*)
|
||||
pPassword : UDINT; (*pointer to the password for authentication*)
|
||||
pSender : UDINT; (*pointer to the name of sender*)
|
||||
pReceiver : UDINT; (*pointer to the ip addresses of receiver*)
|
||||
pSubject : UDINT; (*pointer to the subject string*)
|
||||
pText : UDINT; (*pointer to the text string*)
|
||||
pDomain : UDINT; (*pointer to the sender domain*)
|
||||
pAttachment : UDINT; (*pointer to the attachment structure field*)
|
||||
pSecurity : UDINT; (*reserved for future use*)
|
||||
timeout : UDINT; (*response timeout for connection establishment with smtp server*)
|
||||
port : UINT; (*port of mail server*)
|
||||
attcnt : USINT; (*number of attachments*)
|
||||
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 SmtpsSend (*sends email; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pHost : UDINT; (*pointer to the ip address of mail server*)
|
||||
pUser : UDINT; (*pointer to the user name for authentication*)
|
||||
pPassword : UDINT; (*pointer to the password for authentication*)
|
||||
pSender : UDINT; (*pointer to the name of sender*)
|
||||
pReceiver : UDINT; (*pointer to the ip addresses of receiver*)
|
||||
pSubject : UDINT; (*pointer to the subject string*)
|
||||
pText : UDINT; (*pointer to the text string*)
|
||||
pDomain : UDINT; (*pointer to the sender domain*)
|
||||
pAttachment : UDINT; (*pointer to the attachment structure field*)
|
||||
sslCfgIdent : UDINT; (*identifier of the SSL configuration*)
|
||||
timeout : UDINT; (*response timeout for connection establishment with smtp server*)
|
||||
port : UINT; (*port of mail server*)
|
||||
attcnt : USINT; (*number of attachments*)
|
||||
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
|
||||
9
Logical/Libraries/AsSMTP/AsSMTP.typ
Normal file
9
Logical/Libraries/AsSMTP/AsSMTP.typ
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
TYPE
|
||||
smtpATTACHMENT_typ : STRUCT (*attachments*)
|
||||
type : UDINT; (*type of attachment (file, module or memory area)*)
|
||||
pData : UDINT; (*pointer to the data (depends on attachment type: filename, modulename or memory address)*)
|
||||
length : UDINT; (*length of memory (only for memory attachments)*)
|
||||
pName : UDINT; (*name of attachment (optional, default: filename, modulename or mematt_<# of attachment>)*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
22
Logical/Libraries/AsSMTP/AsSMTP.var
Normal file
22
Logical/Libraries/AsSMTP/AsSMTP.var
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
smtpERR_PARAMETER : UINT := 32700; (*invalid parameter, check parameter*)
|
||||
smtpERR_SOCKET_CREATE : UINT := 32701; (*create socket failed*)
|
||||
smtpERR_SOCKET_CONNECT : UINT := 32702; (*connect socket failed*)
|
||||
smtpERR_RESPONSE_TIMEOUT : UINT := 32703; (*server response timeout*)
|
||||
smtpERR_RESPONSE_UNEXPECTED : UINT := 32704; (*unexpected response*)
|
||||
smtpERR_AUTHENTICATION_METHOD : UINT := 32705; (*no supported authentication method*)
|
||||
smtpERR_AUTHENTICATION_FAILED : UINT := 32706; (*authentication failed*)
|
||||
smtpERR_ATTACHMENT_INVALID : UINT := 32707; (*invalid attachment*)
|
||||
|
||||
smtpERR_SSL : UINT := 32708; (*common SSL error*)
|
||||
smtpERR_HANDSHAKE : UINT := 32709; (*SSL handshake failed*)
|
||||
smtpERR_INVALID_SSL_CONFIG : UINT := 32710; (*invalid SSL configuration given*)
|
||||
|
||||
smtpERR_SYSTEM : UINT := 32749; (*system error*)
|
||||
|
||||
smtpATT_TYPE_FILE : USINT := 1; (*attachment type file*)
|
||||
smtpATT_TYPE_DATMOD : USINT := 2; (*attachment type datamodule*)
|
||||
smtpATT_TYPE_MEMORY : USINT := 3; (*attachment type memory area*)
|
||||
END_VAR
|
||||
96
Logical/Libraries/AsSMTP/SG3/AsSMTP.h
Normal file
96
Logical/Libraries/AsSMTP/SG3/AsSMTP.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASSMTP_
|
||||
#define _ASSMTP_
|
||||
#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 smtpATT_TYPE_MEMORY 3U
|
||||
#define smtpATT_TYPE_DATMOD 2U
|
||||
#define smtpATT_TYPE_FILE 1U
|
||||
#define smtpERR_SYSTEM 32749U
|
||||
#define smtpERR_ATTACHMENT_INVALID 32707U
|
||||
#define smtpERR_AUTHENTICATION_FAILED 32706U
|
||||
#define smtpERR_AUTHENTICATION_METHOD 32705U
|
||||
#define smtpERR_RESPONSE_UNEXPECTED 32704U
|
||||
#define smtpERR_RESPONSE_TIMEOUT 32703U
|
||||
#define smtpERR_SOCKET_CONNECT 32702U
|
||||
#define smtpERR_SOCKET_CREATE 32701U
|
||||
#define smtpERR_PARAMETER 32700U
|
||||
#else
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_MEMORY = 3U;
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_DATMOD = 2U;
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_FILE = 1U;
|
||||
_IEC_CONST unsigned short smtpERR_SYSTEM = 32749U;
|
||||
_IEC_CONST unsigned short smtpERR_ATTACHMENT_INVALID = 32707U;
|
||||
_IEC_CONST unsigned short smtpERR_AUTHENTICATION_FAILED = 32706U;
|
||||
_IEC_CONST unsigned short smtpERR_AUTHENTICATION_METHOD = 32705U;
|
||||
_IEC_CONST unsigned short smtpERR_RESPONSE_UNEXPECTED = 32704U;
|
||||
_IEC_CONST unsigned short smtpERR_RESPONSE_TIMEOUT = 32703U;
|
||||
_IEC_CONST unsigned short smtpERR_SOCKET_CONNECT = 32702U;
|
||||
_IEC_CONST unsigned short smtpERR_SOCKET_CREATE = 32701U;
|
||||
_IEC_CONST unsigned short smtpERR_PARAMETER = 32700U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct smtpATTACHMENT_typ
|
||||
{ unsigned long type;
|
||||
unsigned long pData;
|
||||
unsigned long length;
|
||||
unsigned long pName;
|
||||
} smtpATTACHMENT_typ;
|
||||
|
||||
typedef struct SmtpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pHost;
|
||||
unsigned long pUser;
|
||||
unsigned long pPassword;
|
||||
unsigned long pSender;
|
||||
unsigned long pReceiver;
|
||||
unsigned long pSubject;
|
||||
unsigned long pText;
|
||||
unsigned long pDomain;
|
||||
unsigned long pAttachment;
|
||||
unsigned long pSecurity;
|
||||
unsigned long timeout;
|
||||
unsigned short port;
|
||||
unsigned char attcnt;
|
||||
/* 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;
|
||||
} SmtpSend_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void SmtpSend(struct SmtpSend* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASSMTP_ */
|
||||
|
||||
|
||||
130
Logical/Libraries/AsSMTP/SG4/AsSMTP.h
Normal file
130
Logical/Libraries/AsSMTP/SG4/AsSMTP.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASSMTP_
|
||||
#define _ASSMTP_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define smtpATT_TYPE_MEMORY 3U
|
||||
#define smtpATT_TYPE_DATMOD 2U
|
||||
#define smtpATT_TYPE_FILE 1U
|
||||
#define smtpERR_SYSTEM 32749U
|
||||
#define smtpERR_INVALID_SSL_CONFIG 32710U
|
||||
#define smtpERR_HANDSHAKE 32709U
|
||||
#define smtpERR_SSL 32708U
|
||||
#define smtpERR_ATTACHMENT_INVALID 32707U
|
||||
#define smtpERR_AUTHENTICATION_FAILED 32706U
|
||||
#define smtpERR_AUTHENTICATION_METHOD 32705U
|
||||
#define smtpERR_RESPONSE_UNEXPECTED 32704U
|
||||
#define smtpERR_RESPONSE_TIMEOUT 32703U
|
||||
#define smtpERR_SOCKET_CONNECT 32702U
|
||||
#define smtpERR_SOCKET_CREATE 32701U
|
||||
#define smtpERR_PARAMETER 32700U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned char smtpATT_TYPE_MEMORY;
|
||||
_GLOBAL_CONST unsigned char smtpATT_TYPE_DATMOD;
|
||||
_GLOBAL_CONST unsigned char smtpATT_TYPE_FILE;
|
||||
_GLOBAL_CONST unsigned short smtpERR_SYSTEM;
|
||||
_GLOBAL_CONST unsigned short smtpERR_INVALID_SSL_CONFIG;
|
||||
_GLOBAL_CONST unsigned short smtpERR_HANDSHAKE;
|
||||
_GLOBAL_CONST unsigned short smtpERR_SSL;
|
||||
_GLOBAL_CONST unsigned short smtpERR_ATTACHMENT_INVALID;
|
||||
_GLOBAL_CONST unsigned short smtpERR_AUTHENTICATION_FAILED;
|
||||
_GLOBAL_CONST unsigned short smtpERR_AUTHENTICATION_METHOD;
|
||||
_GLOBAL_CONST unsigned short smtpERR_RESPONSE_UNEXPECTED;
|
||||
_GLOBAL_CONST unsigned short smtpERR_RESPONSE_TIMEOUT;
|
||||
_GLOBAL_CONST unsigned short smtpERR_SOCKET_CONNECT;
|
||||
_GLOBAL_CONST unsigned short smtpERR_SOCKET_CREATE;
|
||||
_GLOBAL_CONST unsigned short smtpERR_PARAMETER;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct smtpATTACHMENT_typ
|
||||
{ unsigned long type;
|
||||
unsigned long pData;
|
||||
unsigned long length;
|
||||
unsigned long pName;
|
||||
} smtpATTACHMENT_typ;
|
||||
|
||||
typedef struct SmtpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pHost;
|
||||
unsigned long pUser;
|
||||
unsigned long pPassword;
|
||||
unsigned long pSender;
|
||||
unsigned long pReceiver;
|
||||
unsigned long pSubject;
|
||||
unsigned long pText;
|
||||
unsigned long pDomain;
|
||||
unsigned long pAttachment;
|
||||
unsigned long pSecurity;
|
||||
unsigned long timeout;
|
||||
unsigned short port;
|
||||
unsigned char attcnt;
|
||||
/* 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;
|
||||
} SmtpSend_typ;
|
||||
|
||||
typedef struct SmtpsSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pHost;
|
||||
unsigned long pUser;
|
||||
unsigned long pPassword;
|
||||
unsigned long pSender;
|
||||
unsigned long pReceiver;
|
||||
unsigned long pSubject;
|
||||
unsigned long pText;
|
||||
unsigned long pDomain;
|
||||
unsigned long pAttachment;
|
||||
unsigned long sslCfgIdent;
|
||||
unsigned long timeout;
|
||||
unsigned short port;
|
||||
unsigned char attcnt;
|
||||
/* 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;
|
||||
} SmtpsSend_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void SmtpSend(struct SmtpSend* inst);
|
||||
_BUR_PUBLIC void SmtpsSend(struct SmtpsSend* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASSMTP_ */
|
||||
|
||||
96
Logical/Libraries/AsSMTP/SGC/AsSMTP.h
Normal file
96
Logical/Libraries/AsSMTP/SGC/AsSMTP.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASSMTP_
|
||||
#define _ASSMTP_
|
||||
#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 smtpATT_TYPE_MEMORY 3U
|
||||
#define smtpATT_TYPE_DATMOD 2U
|
||||
#define smtpATT_TYPE_FILE 1U
|
||||
#define smtpERR_SYSTEM 32749U
|
||||
#define smtpERR_ATTACHMENT_INVALID 32707U
|
||||
#define smtpERR_AUTHENTICATION_FAILED 32706U
|
||||
#define smtpERR_AUTHENTICATION_METHOD 32705U
|
||||
#define smtpERR_RESPONSE_UNEXPECTED 32704U
|
||||
#define smtpERR_RESPONSE_TIMEOUT 32703U
|
||||
#define smtpERR_SOCKET_CONNECT 32702U
|
||||
#define smtpERR_SOCKET_CREATE 32701U
|
||||
#define smtpERR_PARAMETER 32700U
|
||||
#else
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_MEMORY = 3U;
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_DATMOD = 2U;
|
||||
_IEC_CONST unsigned char smtpATT_TYPE_FILE = 1U;
|
||||
_IEC_CONST unsigned short smtpERR_SYSTEM = 32749U;
|
||||
_IEC_CONST unsigned short smtpERR_ATTACHMENT_INVALID = 32707U;
|
||||
_IEC_CONST unsigned short smtpERR_AUTHENTICATION_FAILED = 32706U;
|
||||
_IEC_CONST unsigned short smtpERR_AUTHENTICATION_METHOD = 32705U;
|
||||
_IEC_CONST unsigned short smtpERR_RESPONSE_UNEXPECTED = 32704U;
|
||||
_IEC_CONST unsigned short smtpERR_RESPONSE_TIMEOUT = 32703U;
|
||||
_IEC_CONST unsigned short smtpERR_SOCKET_CONNECT = 32702U;
|
||||
_IEC_CONST unsigned short smtpERR_SOCKET_CREATE = 32701U;
|
||||
_IEC_CONST unsigned short smtpERR_PARAMETER = 32700U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct smtpATTACHMENT_typ
|
||||
{ unsigned long type;
|
||||
unsigned long pData;
|
||||
unsigned long length;
|
||||
unsigned long pName;
|
||||
} smtpATTACHMENT_typ;
|
||||
|
||||
typedef struct SmtpSend
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pHost;
|
||||
unsigned long pUser;
|
||||
unsigned long pPassword;
|
||||
unsigned long pSender;
|
||||
unsigned long pReceiver;
|
||||
unsigned long pSubject;
|
||||
unsigned long pText;
|
||||
unsigned long pDomain;
|
||||
unsigned long pAttachment;
|
||||
unsigned long pSecurity;
|
||||
unsigned long timeout;
|
||||
unsigned short port;
|
||||
unsigned char attcnt;
|
||||
/* 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;
|
||||
} SmtpSend_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void SmtpSend(struct SmtpSend* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASSMTP_ */
|
||||
|
||||
|
||||
12
Logical/Libraries/AsSMTP/binary.lby
Normal file
12
Logical/Libraries/AsSMTP/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains FBKs for sending email over an SMTP (Simple Mail Transfer Protocol) server." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsSMTP.fun</File>
|
||||
<File>AsSMTP.typ</File>
|
||||
<File>AsSMTP.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
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
|
||||
|
||||
|
||||
37
Logical/Libraries/AsUSB/AsUSB.var
Normal file
37
Logical/Libraries/AsUSB/AsUSB.var
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
VAR CONSTANT
|
||||
asusb_CLASS_CDC : USINT := 2; (* USB Communications and CDC Control class code *)
|
||||
asusb_CLASS_HID : USINT := 3; (* USB Human Interface Interfaces class code *)
|
||||
asusb_CLASS_PRINTER : USINT := 7; (* USB Printer class code *)
|
||||
asusb_CLASS_MASS_STORAGE : USINT := 8; (* USB Mass storage class code *)
|
||||
asusb_CLASS_HUB : USINT := 9; (* USB Hub class code *)
|
||||
asusb_CLASS_VENDOR_SPECIFIC : USINT := 255; (* USB Vendor specific *)
|
||||
|
||||
asusb_SUBCLASS_PRINTER : USINT := 1; (* USB PRINTER subclass code *)
|
||||
asusb_SUBCLASS_HID_BOOT : USINT := 1; (* USB HID Boot *)
|
||||
asusb_SUBCLASS_UFI_COMMAND_SET : USINT := 4; (* USB UFI command set *)
|
||||
asusb_SUBCLASS_SCSI_COMMAND_SET : USINT := 6; (* SCSI command set definition *)
|
||||
|
||||
asusb_DEVICENAMELENGTH : USINT := 128;
|
||||
|
||||
asusb_USB_RT_DEVICE : USINT := 0; (* Requesttype for device *)
|
||||
asusb_USB_RT_INTERFACE : USINT := 1; (* Requesttype for interface *)
|
||||
asusb_USB_RT_ENDPOINT : USINT := 2; (* Requesttype for endpoint *)
|
||||
|
||||
asusb_USB_RT_STANDARD : USINT := 0; (* Requesttype standard *)
|
||||
asusb_USB_RT_CLASS : USINT := 32; (* Requesttype class-specific *)
|
||||
asusb_USB_RT_VENDOR : USINT := 64; (* Requesttype vendor-specific *)
|
||||
|
||||
asusb_USB_DESCR_DEVICE : USINT := 1; (* Specifies the DEVICE descriptor *)
|
||||
asusb_USB_DESCR_CONFIG : USINT := 2; (* Specifies the CONFIGURATION descriptor *)
|
||||
asusb_USB_DESCR_STRING : USINT := 3; (* Specifies a STRING descriptor *)
|
||||
asusb_USB_DESCR_INTERFACE : USINT := 4; (* Specifies an INTERFACE descriptor *)
|
||||
asusb_USB_DESCR_ENDPOINT : USINT := 5; (* Specifies an ENDPOINT descriptor *)
|
||||
|
||||
asusb_USB_UNICODE_ENGLISH : UINT := 1033; (* languageId unicode english *)
|
||||
|
||||
asusbERR_USB_NOTFOUND : UINT := 32900; (* Es wurde kein USB Ger<65>t gefunden keine USB Ger<65>te angesteckt *)
|
||||
asusbERR_BUFSIZE : UINT := 32901; (* Die <20>bergebene Speicherl<72>nge ist zu klein Gr<47><72>eren Speicher reservieren *)
|
||||
asusbERR_NULLPOINTER : UINT := 32902; (* pBuffer ist nicht gesetzt pBuffer setzen *)
|
||||
|
||||
END_VAR
|
||||
233
Logical/Libraries/AsUSB/SG4/AsUSB.h
Normal file
233
Logical/Libraries/AsUSB/SG4/AsUSB.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASUSB_
|
||||
#define _ASUSB_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define asusbERR_NULLPOINTER 32902U
|
||||
#define asusbERR_BUFSIZE 32901U
|
||||
#define asusbERR_USB_NOTFOUND 32900U
|
||||
#define asusb_USB_UNICODE_ENGLISH 1033U
|
||||
#define asusb_USB_DESCR_ENDPOINT 5U
|
||||
#define asusb_USB_DESCR_INTERFACE 4U
|
||||
#define asusb_USB_DESCR_STRING 3U
|
||||
#define asusb_USB_DESCR_CONFIG 2U
|
||||
#define asusb_USB_DESCR_DEVICE 1U
|
||||
#define asusb_USB_RT_VENDOR 64U
|
||||
#define asusb_USB_RT_CLASS 32U
|
||||
#define asusb_USB_RT_STANDARD 0U
|
||||
#define asusb_USB_RT_ENDPOINT 2U
|
||||
#define asusb_USB_RT_INTERFACE 1U
|
||||
#define asusb_USB_RT_DEVICE 0U
|
||||
#define asusb_DEVICENAMELENGTH 128U
|
||||
#define asusb_SUBCLASS_SCSI_COMMAND_SET 6U
|
||||
#define asusb_SUBCLASS_UFI_COMMAND_SET 4U
|
||||
#define asusb_SUBCLASS_HID_BOOT 1U
|
||||
#define asusb_SUBCLASS_PRINTER 1U
|
||||
#define asusb_CLASS_VENDOR_SPECIFIC 255U
|
||||
#define asusb_CLASS_HUB 9U
|
||||
#define asusb_CLASS_MASS_STORAGE 8U
|
||||
#define asusb_CLASS_PRINTER 7U
|
||||
#define asusb_CLASS_HID 3U
|
||||
#define asusb_CLASS_CDC 2U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned short asusbERR_NULLPOINTER;
|
||||
_GLOBAL_CONST unsigned short asusbERR_BUFSIZE;
|
||||
_GLOBAL_CONST unsigned short asusbERR_USB_NOTFOUND;
|
||||
_GLOBAL_CONST unsigned short asusb_USB_UNICODE_ENGLISH;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_DESCR_ENDPOINT;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_DESCR_INTERFACE;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_DESCR_STRING;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_DESCR_CONFIG;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_DESCR_DEVICE;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_VENDOR;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_CLASS;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_STANDARD;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_ENDPOINT;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_INTERFACE;
|
||||
_GLOBAL_CONST unsigned char asusb_USB_RT_DEVICE;
|
||||
_GLOBAL_CONST unsigned char asusb_DEVICENAMELENGTH;
|
||||
_GLOBAL_CONST unsigned char asusb_SUBCLASS_SCSI_COMMAND_SET;
|
||||
_GLOBAL_CONST unsigned char asusb_SUBCLASS_UFI_COMMAND_SET;
|
||||
_GLOBAL_CONST unsigned char asusb_SUBCLASS_HID_BOOT;
|
||||
_GLOBAL_CONST unsigned char asusb_SUBCLASS_PRINTER;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_VENDOR_SPECIFIC;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_HUB;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_MASS_STORAGE;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_PRINTER;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_HID;
|
||||
_GLOBAL_CONST unsigned char asusb_CLASS_CDC;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct usbNode_typ
|
||||
{ unsigned short interfaceClass;
|
||||
unsigned short interfaceSubClass;
|
||||
unsigned short interfaceProtocol;
|
||||
unsigned short vendorId;
|
||||
unsigned short productId;
|
||||
unsigned short bcdDevice;
|
||||
plcstring ifName[128];
|
||||
} usbNode_typ;
|
||||
|
||||
typedef struct usbDeviceDescr_typ
|
||||
{ unsigned char length;
|
||||
unsigned char descriptorType;
|
||||
unsigned short bcdUsb;
|
||||
unsigned char deviceClass;
|
||||
unsigned char deviceSubClass;
|
||||
unsigned char deviceProtocol;
|
||||
unsigned char maxPacketSize0;
|
||||
unsigned short vendor;
|
||||
unsigned short product;
|
||||
unsigned short bcdDevice;
|
||||
unsigned char manufacturerIndex;
|
||||
unsigned char productIndex;
|
||||
unsigned char serialNumberIndex;
|
||||
unsigned char numConfigurations;
|
||||
} usbDeviceDescr_typ;
|
||||
|
||||
typedef struct usbConfigDescr_typ
|
||||
{ unsigned char bLength;
|
||||
unsigned char bDescriptorType;
|
||||
unsigned short wTotalLength;
|
||||
unsigned char bNumInterfaces;
|
||||
unsigned char bConfigurationValue;
|
||||
unsigned char iConfiguration;
|
||||
unsigned char bmAttributes;
|
||||
unsigned char MaxPower;
|
||||
} usbConfigDescr_typ;
|
||||
|
||||
typedef struct usbStringDescr_typ
|
||||
{ unsigned char length;
|
||||
unsigned char descriptorType;
|
||||
plcstring string[2];
|
||||
} usbStringDescr_typ;
|
||||
|
||||
typedef struct usbInterfaceDescr_typ
|
||||
{ unsigned char bLength;
|
||||
unsigned char bDescriptorType;
|
||||
unsigned char bInterfaceNumber;
|
||||
unsigned char bAlternateSetting;
|
||||
unsigned char bNumEndpoints;
|
||||
unsigned char bInterfaceClass;
|
||||
unsigned char bInterfaceSubClass;
|
||||
unsigned char bInterfaceProtocol;
|
||||
unsigned char iInterface;
|
||||
} usbInterfaceDescr_typ;
|
||||
|
||||
typedef struct usbEndpointDescr_typ
|
||||
{ unsigned char bLength;
|
||||
unsigned char bDescriptorType;
|
||||
unsigned char bEndpointAddress;
|
||||
unsigned char bmAttributes;
|
||||
unsigned short wMaxPacketSize;
|
||||
unsigned char bInterval;
|
||||
} usbEndpointDescr_typ;
|
||||
|
||||
typedef struct UsbNodeListGet
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pBuffer;
|
||||
unsigned long bufferSize;
|
||||
unsigned short filterInterfaceClass;
|
||||
unsigned short filterInterfaceSubClass;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long allNodes;
|
||||
unsigned long listNodes;
|
||||
unsigned long attachDetachCount;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UsbNodeListGet_typ;
|
||||
|
||||
typedef struct UsbNodeGet
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long nodeId;
|
||||
unsigned long pBuffer;
|
||||
unsigned long bufferSize;
|
||||
/* 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;
|
||||
} UsbNodeGet_typ;
|
||||
|
||||
typedef struct UsbDescriptorGet
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long nodeId;
|
||||
unsigned char requestType;
|
||||
unsigned char descriptorType;
|
||||
unsigned char descriptorIndex;
|
||||
unsigned short languageId;
|
||||
unsigned long pBuffer;
|
||||
unsigned short bufferSize;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short actSize;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UsbDescriptorGet_typ;
|
||||
|
||||
typedef struct UsbMsDeviceReady
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pIfName;
|
||||
/* 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;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit ready;
|
||||
} UsbMsDeviceReady_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void UsbNodeListGet(struct UsbNodeListGet* inst);
|
||||
_BUR_PUBLIC void UsbNodeGet(struct UsbNodeGet* inst);
|
||||
_BUR_PUBLIC void UsbDescriptorGet(struct UsbDescriptorGet* inst);
|
||||
_BUR_PUBLIC void UsbMsDeviceReady(struct UsbMsDeviceReady* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASUSB_ */
|
||||
|
||||
12
Logical/Libraries/AsUSB/binary.lby
Normal file
12
Logical/Libraries/AsUSB/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains function blocks to handle USB devices on the target." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsUSB.fun</File>
|
||||
<File>AsUSB.typ</File>
|
||||
<File>AsUSB.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
98
Logical/Libraries/DRV_mbus/DRV_mbus.fun
Normal file
98
Logical/Libraries/DRV_mbus/DRV_mbus.fun
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBMCmd (*operates the modbus protocol in runtime*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*identifier of the MBMOpen() FBK*)
|
||||
mfc :USINT; (*modbus function call*)
|
||||
node :USINT; (*station number (0 = broadcast)*)
|
||||
data :UDINT; (*pointer to the data area*)
|
||||
offset :UINT; (*offset*)
|
||||
len :UINT; (*size of data*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBMClose (*closes the driver environment to enable the MBMOpen() FBK to be called again*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*identifier of the MBMOpen() FBK*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBMaster (*operates the modbus protocol in runtime*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*identifier of the MBMOpen() FBK*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
execute :BOOL; (*command executed (execute = 1)*)
|
||||
recordnum :UINT; (*number of the entry in the data object currently being processed*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBMOpen (*configures the interface and initializes the internal structures that are required*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDevice :UDINT; (*device name given as a pointer*)
|
||||
pMode :UDINT; (*pointer to the mode description string*)
|
||||
pConfig :UDINT; (*pointer to the data object name*)
|
||||
timeout :UINT; (*response timeout in milliseconds (the value must be a multiple of 10)*)
|
||||
ascii :USINT; (*modBus mode (0 = RTU / 1 = ASCII)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident :UDINT; (*identifier for the MBMaster(), MBMCmd() and MBMClose() FBKs*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBSClose (*closes the driver environment to enable the MBSOpen() FBK to be called again*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*identifier of the MBSOpen() FBK*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
InitCount :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBSlave (*operates the modbus protocol in runtime*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*identifier of the MBSOpen() FBK*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
exec :UINT; (*counter for modbus commands received*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK MBSOpen (*configures the interface and initializes the internal structures that are required*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDevice :UDINT; (*device name given as a pointer*)
|
||||
pMode :UDINT; (*pointer to the mode description string*)
|
||||
pCoilStat :UDINT; (*pointer to the coil status (modbus simulation variable)*)
|
||||
pInputStat :UDINT; (*pointer to the input status (modbus simulation variable)*)
|
||||
pHoldingReg :UDINT; (*pointer to the holding register (modbus simulation variable)*)
|
||||
pInputReg :UDINT; (*pointer to the input register (modbus simulation variable)*)
|
||||
own_ID :USINT; (*own node number*)
|
||||
timeout :UINT; (*response timeout in milliseconds (the value must be a multiple of 10)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident :UDINT; (*identifier for the MBClient() and MBSClose() FBKs*)
|
||||
END_VAR
|
||||
VAR
|
||||
FirstInit :UDINT; (*internal variable*)
|
||||
InitCount :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
4
Logical/Libraries/DRV_mbus/DRV_mbus.typ
Normal file
4
Logical/Libraries/DRV_mbus/DRV_mbus.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
28
Logical/Libraries/DRV_mbus/DRV_mbus.var
Normal file
28
Logical/Libraries/DRV_mbus/DRV_mbus.var
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
VAR CONSTANT
|
||||
mbERR_INVALID_PARAM : UINT := 20201; (*invalid FBK parameter (e.g. pDevice = 0)*)
|
||||
mbERR_ILG_O_NODE_N : UINT := 20205; (*invalid own_ID stated in MBSOpen() FBK; valid IDs are between 1 and 247*)
|
||||
mbERR_ILG_IDENT : UINT := 20210; (*invalid ID or ID is 0*)
|
||||
mbERR_ILG_MBVAR : UINT := 20215; (*ModBus simulation variable invalid or missing (MBSOpen() and MBSlave() FBK)*)
|
||||
mbERR_NODE_TOUT : UINT := 20220; (*in MBSOpen(), MBMOpen(): invalid value for timeout parameter, in MBMCmd(), MBMaster(), MBSlave(): timeout detected*)
|
||||
mbERR_CMD_ENTRY : UINT := 20240; (*invalid entry in data object, invalid length of data object*)
|
||||
mbERR_CMD_NULL : UINT := 20241; (*data object not present or data parameter in MBMCmd FBK is 0*)
|
||||
mbERR_CMD_EVENTPV : UINT := 20242; (*invalid EventPV stated in the data object*)
|
||||
mbERR_CMD_FUNCTION : UINT := 20243; (*invalid ModBus function stated in the data object or in the MBMCmd() FBK*)
|
||||
mbERR_CMD_NODE : UINT := 20244; (*invalid nodenumber stated in the data object or in the MBMCmd() FBK*)
|
||||
mbERR_CMD_LOCALPV : UINT := 20245; (*invalid EventPV stated in the data object*)
|
||||
mbERR_CMD_LENGTH : UINT := 20246; (*invalid length stated in the data object*)
|
||||
mbERR_NO_MEM : UINT := 20250; (*no memory for internal library management*)
|
||||
mbERR_MEM_FREE : UINT := 20252; (*memory for internal library management cannot be freed*)
|
||||
mbERR_RESP_ERROR : UINT := 20260; (*invalid frame received*)
|
||||
mbERR_RESP_LENGTH : UINT := 20261; (*frame with wrong length received*)
|
||||
mbERR_RESP_INVALID : UINT := 20262; (*error in frame*)
|
||||
mbERR_RESP_CRC : UINT := 20263; (*error in frame check (CRC / LRC) MBMaster() and MBMCmd()*)
|
||||
mbERR_QUERY_CRC : UINT := 20264; (*error in frame check (CRC) MBMSlave()*)
|
||||
mbERR_FRM_READ : UINT := 20291; (*error while receiving a frame (FRM_read())*)
|
||||
mbERR_FRM_GETBUF : UINT := 20292; (*no write buffer available (FRM_gbuf())*)
|
||||
mbERR_FRM_WRITE : UINT := 20293; (*error while writing a frame (FRM_write())*)
|
||||
mbERR_FRM_RELOUTBUF : UINT := 20294; (*error in buffer return (FRM_robuf())*)
|
||||
mbERR_FRM_RELBUF : UINT := 20295; (*error in buffer return (FRM_rbuf())*)
|
||||
mbERR_FRM_CLOSE : UINT := 20296; (*error while closing the interface (FRM_close())*)
|
||||
END_VAR
|
||||
193
Logical/Libraries/DRV_mbus/SG3/DRV_mbus.h
Normal file
193
Logical/Libraries/DRV_mbus/SG3/DRV_mbus.h
Normal file
@@ -0,0 +1,193 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DRV_MBUS_
|
||||
#define _DRV_MBUS_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <DataObj.h>
|
||||
#include <dvframe.h>
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define mbERR_INVALID_PARAM 20201U
|
||||
#define mbERR_ILG_O_NODE_N 20205U
|
||||
#define mbERR_ILG_IDENT 20210U
|
||||
#define mbERR_ILG_MBVAR 20215U
|
||||
#define mbERR_NODE_TOUT 20220U
|
||||
#define mbERR_CMD_ENTRY 20240U
|
||||
#define mbERR_CMD_NULL 20241U
|
||||
#define mbERR_CMD_EVENTPV 20242U
|
||||
#define mbERR_CMD_FUNCTION 20243U
|
||||
#define mbERR_CMD_NODE 20244U
|
||||
#define mbERR_CMD_LOCALPV 20245U
|
||||
#define mbERR_CMD_LENGTH 20246U
|
||||
#define mbERR_NO_MEM 20250U
|
||||
#define mbERR_MEM_FREE 20252U
|
||||
#define mbERR_RESP_ERROR 20260U
|
||||
#define mbERR_RESP_LENGTH 20261U
|
||||
#define mbERR_RESP_INVALID 20262U
|
||||
#define mbERR_RESP_CRC 20263U
|
||||
#define mbERR_QUERY_CRC 20264U
|
||||
#define mbERR_FRM_READ 20291U
|
||||
#define mbERR_FRM_GETBUF 20292U
|
||||
#define mbERR_FRM_WRITE 20293U
|
||||
#define mbERR_FRM_RELOUTBUF 20294U
|
||||
#define mbERR_FRM_RELBUF 20295U
|
||||
#define mbERR_FRM_CLOSE 20296U
|
||||
#else
|
||||
_IEC_CONST unsigned short mbERR_INVALID_PARAM = 20201U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_O_NODE_N = 20205U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_IDENT = 20210U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_MBVAR = 20215U;
|
||||
_IEC_CONST unsigned short mbERR_NODE_TOUT = 20220U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_ENTRY = 20240U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_NULL = 20241U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_EVENTPV = 20242U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_FUNCTION = 20243U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_NODE = 20244U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_LOCALPV = 20245U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_LENGTH = 20246U;
|
||||
_IEC_CONST unsigned short mbERR_NO_MEM = 20250U;
|
||||
_IEC_CONST unsigned short mbERR_MEM_FREE = 20252U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_ERROR = 20260U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_LENGTH = 20261U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_INVALID = 20262U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_CRC = 20263U;
|
||||
_IEC_CONST unsigned short mbERR_QUERY_CRC = 20264U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_READ = 20291U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_GETBUF = 20292U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_WRITE = 20293U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_RELOUTBUF = 20294U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_RELBUF = 20295U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_CLOSE = 20296U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct MBMCmd
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char mfc;
|
||||
unsigned char node;
|
||||
unsigned long data;
|
||||
unsigned short offset;
|
||||
unsigned short len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMCmd_typ;
|
||||
|
||||
typedef struct MBMClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMClose_typ;
|
||||
|
||||
typedef struct MBMaster
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short recordnum;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit execute;
|
||||
} MBMaster_typ;
|
||||
|
||||
typedef struct MBMOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pConfig;
|
||||
unsigned short timeout;
|
||||
unsigned char ascii;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMOpen_typ;
|
||||
|
||||
typedef struct MBSClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSClose_typ;
|
||||
|
||||
typedef struct MBSlave
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short exec;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSlave_typ;
|
||||
|
||||
typedef struct MBSOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pCoilStat;
|
||||
unsigned long pInputStat;
|
||||
unsigned long pHoldingReg;
|
||||
unsigned long pInputReg;
|
||||
unsigned char own_ID;
|
||||
unsigned short timeout;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned long FirstInit;
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSOpen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void MBMCmd(struct MBMCmd* inst);
|
||||
void MBMClose(struct MBMClose* inst);
|
||||
void MBMaster(struct MBMaster* inst);
|
||||
void MBMOpen(struct MBMOpen* inst);
|
||||
void MBSClose(struct MBSClose* inst);
|
||||
void MBSlave(struct MBSlave* inst);
|
||||
void MBSOpen(struct MBSOpen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DRV_MBUS_ */
|
||||
|
||||
195
Logical/Libraries/DRV_mbus/SG4/DRV_mbus.h
Normal file
195
Logical/Libraries/DRV_mbus/SG4/DRV_mbus.h
Normal file
@@ -0,0 +1,195 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DRV_MBUS_
|
||||
#define _DRV_MBUS_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <DataObj.h>
|
||||
#include <dvframe.h>
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define mbERR_FRM_CLOSE 20296U
|
||||
#define mbERR_FRM_RELBUF 20295U
|
||||
#define mbERR_FRM_RELOUTBUF 20294U
|
||||
#define mbERR_FRM_WRITE 20293U
|
||||
#define mbERR_FRM_GETBUF 20292U
|
||||
#define mbERR_FRM_READ 20291U
|
||||
#define mbERR_QUERY_CRC 20264U
|
||||
#define mbERR_RESP_CRC 20263U
|
||||
#define mbERR_RESP_INVALID 20262U
|
||||
#define mbERR_RESP_LENGTH 20261U
|
||||
#define mbERR_RESP_ERROR 20260U
|
||||
#define mbERR_MEM_FREE 20252U
|
||||
#define mbERR_NO_MEM 20250U
|
||||
#define mbERR_CMD_LENGTH 20246U
|
||||
#define mbERR_CMD_LOCALPV 20245U
|
||||
#define mbERR_CMD_NODE 20244U
|
||||
#define mbERR_CMD_FUNCTION 20243U
|
||||
#define mbERR_CMD_EVENTPV 20242U
|
||||
#define mbERR_CMD_NULL 20241U
|
||||
#define mbERR_CMD_ENTRY 20240U
|
||||
#define mbERR_NODE_TOUT 20220U
|
||||
#define mbERR_ILG_MBVAR 20215U
|
||||
#define mbERR_ILG_IDENT 20210U
|
||||
#define mbERR_ILG_O_NODE_N 20205U
|
||||
#define mbERR_INVALID_PARAM 20201U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_CLOSE;
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_RELBUF;
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_RELOUTBUF;
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_WRITE;
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_GETBUF;
|
||||
_GLOBAL_CONST unsigned short mbERR_FRM_READ;
|
||||
_GLOBAL_CONST unsigned short mbERR_QUERY_CRC;
|
||||
_GLOBAL_CONST unsigned short mbERR_RESP_CRC;
|
||||
_GLOBAL_CONST unsigned short mbERR_RESP_INVALID;
|
||||
_GLOBAL_CONST unsigned short mbERR_RESP_LENGTH;
|
||||
_GLOBAL_CONST unsigned short mbERR_RESP_ERROR;
|
||||
_GLOBAL_CONST unsigned short mbERR_MEM_FREE;
|
||||
_GLOBAL_CONST unsigned short mbERR_NO_MEM;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_LENGTH;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_LOCALPV;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_NODE;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_FUNCTION;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_EVENTPV;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_NULL;
|
||||
_GLOBAL_CONST unsigned short mbERR_CMD_ENTRY;
|
||||
_GLOBAL_CONST unsigned short mbERR_NODE_TOUT;
|
||||
_GLOBAL_CONST unsigned short mbERR_ILG_MBVAR;
|
||||
_GLOBAL_CONST unsigned short mbERR_ILG_IDENT;
|
||||
_GLOBAL_CONST unsigned short mbERR_ILG_O_NODE_N;
|
||||
_GLOBAL_CONST unsigned short mbERR_INVALID_PARAM;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct MBMCmd
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char mfc;
|
||||
unsigned char node;
|
||||
unsigned long data;
|
||||
unsigned short offset;
|
||||
unsigned short len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMCmd_typ;
|
||||
|
||||
typedef struct MBMClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMClose_typ;
|
||||
|
||||
typedef struct MBMaster
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short recordnum;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit execute;
|
||||
} MBMaster_typ;
|
||||
|
||||
typedef struct MBMOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pConfig;
|
||||
unsigned short timeout;
|
||||
unsigned char ascii;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMOpen_typ;
|
||||
|
||||
typedef struct MBSClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSClose_typ;
|
||||
|
||||
typedef struct MBSlave
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short exec;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSlave_typ;
|
||||
|
||||
typedef struct MBSOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pCoilStat;
|
||||
unsigned long pInputStat;
|
||||
unsigned long pHoldingReg;
|
||||
unsigned long pInputReg;
|
||||
unsigned char own_ID;
|
||||
unsigned short timeout;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned long FirstInit;
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSOpen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void MBMCmd(struct MBMCmd* inst);
|
||||
_BUR_PUBLIC void MBMClose(struct MBMClose* inst);
|
||||
_BUR_PUBLIC void MBMaster(struct MBMaster* inst);
|
||||
_BUR_PUBLIC void MBMOpen(struct MBMOpen* inst);
|
||||
_BUR_PUBLIC void MBSClose(struct MBSClose* inst);
|
||||
_BUR_PUBLIC void MBSlave(struct MBSlave* inst);
|
||||
_BUR_PUBLIC void MBSOpen(struct MBSOpen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DRV_MBUS_ */
|
||||
|
||||
194
Logical/Libraries/DRV_mbus/SGC/DRV_mbus.h
Normal file
194
Logical/Libraries/DRV_mbus/SGC/DRV_mbus.h
Normal file
@@ -0,0 +1,194 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DRV_MBUS_
|
||||
#define _DRV_MBUS_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <DataObj.h>
|
||||
#include <dvframe.h>
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define mbERR_INVALID_PARAM 20201U
|
||||
#define mbERR_ILG_O_NODE_N 20205U
|
||||
#define mbERR_ILG_IDENT 20210U
|
||||
#define mbERR_ILG_MBVAR 20215U
|
||||
#define mbERR_NODE_TOUT 20220U
|
||||
#define mbERR_CMD_ENTRY 20240U
|
||||
#define mbERR_CMD_NULL 20241U
|
||||
#define mbERR_CMD_EVENTPV 20242U
|
||||
#define mbERR_CMD_FUNCTION 20243U
|
||||
#define mbERR_CMD_NODE 20244U
|
||||
#define mbERR_CMD_LOCALPV 20245U
|
||||
#define mbERR_CMD_LENGTH 20246U
|
||||
#define mbERR_NO_MEM 20250U
|
||||
#define mbERR_MEM_FREE 20252U
|
||||
#define mbERR_RESP_ERROR 20260U
|
||||
#define mbERR_RESP_LENGTH 20261U
|
||||
#define mbERR_RESP_INVALID 20262U
|
||||
#define mbERR_RESP_CRC 20263U
|
||||
#define mbERR_QUERY_CRC 20264U
|
||||
#define mbERR_FRM_READ 20291U
|
||||
#define mbERR_FRM_GETBUF 20292U
|
||||
#define mbERR_FRM_WRITE 20293U
|
||||
#define mbERR_FRM_RELOUTBUF 20294U
|
||||
#define mbERR_FRM_RELBUF 20295U
|
||||
#define mbERR_FRM_CLOSE 20296U
|
||||
#else
|
||||
_IEC_CONST unsigned short mbERR_INVALID_PARAM = 20201U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_O_NODE_N = 20205U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_IDENT = 20210U;
|
||||
_IEC_CONST unsigned short mbERR_ILG_MBVAR = 20215U;
|
||||
_IEC_CONST unsigned short mbERR_NODE_TOUT = 20220U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_ENTRY = 20240U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_NULL = 20241U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_EVENTPV = 20242U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_FUNCTION = 20243U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_NODE = 20244U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_LOCALPV = 20245U;
|
||||
_IEC_CONST unsigned short mbERR_CMD_LENGTH = 20246U;
|
||||
_IEC_CONST unsigned short mbERR_NO_MEM = 20250U;
|
||||
_IEC_CONST unsigned short mbERR_MEM_FREE = 20252U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_ERROR = 20260U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_LENGTH = 20261U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_INVALID = 20262U;
|
||||
_IEC_CONST unsigned short mbERR_RESP_CRC = 20263U;
|
||||
_IEC_CONST unsigned short mbERR_QUERY_CRC = 20264U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_READ = 20291U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_GETBUF = 20292U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_WRITE = 20293U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_RELOUTBUF = 20294U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_RELBUF = 20295U;
|
||||
_IEC_CONST unsigned short mbERR_FRM_CLOSE = 20296U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct MBMCmd
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char mfc;
|
||||
unsigned char node;
|
||||
unsigned long data;
|
||||
unsigned short offset;
|
||||
unsigned short len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMCmd_typ;
|
||||
|
||||
typedef struct MBMClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMClose_typ;
|
||||
|
||||
typedef struct MBMaster
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short recordnum;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit execute;
|
||||
} MBMaster_typ;
|
||||
|
||||
typedef struct MBMOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pConfig;
|
||||
unsigned short timeout;
|
||||
unsigned char ascii;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBMOpen_typ;
|
||||
|
||||
typedef struct MBSClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSClose_typ;
|
||||
|
||||
typedef struct MBSlave
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned short exec;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSlave_typ;
|
||||
|
||||
typedef struct MBSOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pMode;
|
||||
unsigned long pCoilStat;
|
||||
unsigned long pInputStat;
|
||||
unsigned long pHoldingReg;
|
||||
unsigned long pInputReg;
|
||||
unsigned char own_ID;
|
||||
unsigned short timeout;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned long FirstInit;
|
||||
unsigned char InitCount;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} MBSOpen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void MBMCmd(struct MBMCmd* inst);
|
||||
void MBMClose(struct MBMClose* inst);
|
||||
void MBMaster(struct MBMaster* inst);
|
||||
void MBMOpen(struct MBMOpen* inst);
|
||||
void MBSClose(struct MBSClose* inst);
|
||||
void MBSlave(struct MBSlave* inst);
|
||||
void MBSOpen(struct MBSOpen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DRV_MBUS_ */
|
||||
|
||||
|
||||
14
Logical/Libraries/DRV_mbus/binary.lby
Normal file
14
Logical/Libraries/DRV_mbus/binary.lby
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The DRV_mbus library provides functions that allow a B&R System to communicate via Modbus communication." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>DRV_mbus.fun</File>
|
||||
<File>DRV_mbus.typ</File>
|
||||
<File>DRV_mbus.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="dvframe" />
|
||||
<Dependency ObjectName="DataObj" />
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
157
Logical/Libraries/DataObj/DataObj.fun
Normal file
157
Logical/Libraries/DataObj/DataObj.fun
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCreate (*creates a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
grp :USINT; (*group ID for the data object (default 0x00), must be set to zero*)
|
||||
pName :UDINT; (*pointer to name of the data object to be created*)
|
||||
len :UDINT; (*length of the data area of the data object to be created*)
|
||||
MemType :USINT; (*type of target memory: doTEMP, doUSRRAM, doUSRROM, doSYSROM, doFIXRAM, doMEMCARD*)
|
||||
Option :UDINT; (*options: doNO_CS*)
|
||||
pCpyData :UDINT; (*pointer to data written to the data object during generation*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident :UDINT; (*ID of the created data object*)
|
||||
pDatObjMem :UDINT; (*pointer to the data in the data object*)
|
||||
END_VAR
|
||||
VAR
|
||||
i_state :UDINT; (*internal variable*)
|
||||
i_result :UDINT; (*internal variable*)
|
||||
i_spare :ARRAY[0..104] OF USINT; (*internal variable*)
|
||||
i_spare_1 :UDINT; (*internal variable*)
|
||||
i_spare_2 :UINT; (*internal variable*)
|
||||
i_spare_3 :UDINT; (*internal variable*)
|
||||
i_spare_4 :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjWrite (*writes to a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
Offset :UDINT; (*offset in the data area of the data object*)
|
||||
pSource :UDINT; (*pointer to the data copied to the data object*)
|
||||
len :UDINT; (*length of the data to be copied*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjRead (*reads from a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
Offset :UDINT; (*offset in the data area of the data object*)
|
||||
pDestination:UDINT; (*memory to which the data to be read is copied*)
|
||||
len :UDINT; (*length of the data to be copied*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDelete (*deletes data objects*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
i_state :UDINT; (*internal variable*)
|
||||
i_result :UDINT; (*internal variable*)
|
||||
i_spare :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjMove (*moves the storage space of a data object to a new target memory*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
MemType :USINT; (*target memory in which the data object is to be saved, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
|
||||
Option :UDINT; (*options for the object to be saved (doNO_CS = no checksum)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
identNew :UDINT; (*ID of the new data object*)
|
||||
pDatObjMem :UDINT; (*pointer to the data in the newly created data object*)
|
||||
END_VAR
|
||||
VAR
|
||||
i_state :UDINT; (*internal variable*)
|
||||
i_result :UDINT; (*internal variable*)
|
||||
i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
|
||||
i_spare_1 :UDINT; (*internal variable*)
|
||||
i_spare_2 :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjCopy (*copies a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object to be copied*)
|
||||
pNameTarget :UDINT; (*pointer to name of the new data object*)
|
||||
MemTypeTarget :USINT; (*target memory in which the new object is to be generated, e.g. doTEMP, doUSRRAM, ...*)
|
||||
OptionTarget :UDINT; (*options for the copied object (doNO_CS = no checksum)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
identNew :UDINT; (*ID of the copied data object*)
|
||||
pDatObjMemNew :UDINT; (*pointer to the data in the newly created data object*)
|
||||
END_VAR
|
||||
VAR
|
||||
i_state :UDINT; (*internal variable*)
|
||||
i_result :UDINT; (*internal variable*)
|
||||
i_spare :ARRAY[0..40] OF USINT; (*internal variable*)
|
||||
i_spare_1 :UDINT; (*internal variable*)
|
||||
i_spare_2 :USINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjInfo (*gives information about a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pName :UDINT; (*name of data object*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
pDatObjMem :UDINT; (*pointer to the data in the data object*)
|
||||
len :UDINT; (*length of the data area in the data object*)
|
||||
MemType :USINT; (*memory type in which the data object is located, e.g. doTEMP, doUSRRAM, doUSRROM, ...*)
|
||||
Option :UDINT; (*information about data object options*)
|
||||
ChangeDate :DATE_AND_TIME; (*modification date of the data object*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjChangeDate (*changes the modification date of a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pName :UDINT; (*pointer to name of data object*)
|
||||
SetDate :DATE_AND_TIME; (*date and time; if the value 0 is transferred, the current PLC system time is used*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjAttach (*attaches a data object to prevent deletion*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DatObjDetach (*detaches a data object*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*ID of the data object*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
14
Logical/Libraries/DataObj/DataObj.typ
Normal file
14
Logical/Libraries/DataObj/DataObj.typ
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
27
Logical/Libraries/DataObj/DataObj.var
Normal file
27
Logical/Libraries/DataObj/DataObj.var
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
VAR CONSTANT
|
||||
doERR_TOOLONG_MODULNAME : UINT := 20613; (*module name too long (max. 10 characters)*)
|
||||
doERR_CHECKSUM_WARNING : UINT := 20630; (*wrong target memory specified for the "doNO_CS" option*)
|
||||
doERR_MODULNOTFOUND : UINT := 20609; (*data object not found*)
|
||||
doERR_ILLEGALLENGTH : UINT := 20608; (*wrong length specified*)
|
||||
doERR_STARTHANDLER : UINT := 20612; (*error while enabling asynchronous handler (only SG4)*)
|
||||
doERR_ILLPARAMETER : UINT := 20600; (*wrong parameter given (NULL pointer)*)
|
||||
doERR_WRONGOFFSET : UINT := 20607; (*wrong offset specified*)
|
||||
doERR_ILLOBJTYPE : UINT := 20606; (*wrong object type (not data object)*)
|
||||
doERR_ILLMEMTYPE : UINT := 20602; (*wrong target memory specified*)
|
||||
doERR_WRONGTIME : UINT := 20610; (*wrong date in SetDate (DatObjChangeDate)*)
|
||||
doERR_ILLOBJECT : UINT := 20605; (*object not found*)
|
||||
doERR_DUPOBJECT : UINT := 20601; (*object already present*)
|
||||
doERR_BRINSTALL : UINT := 20604; (*error installing data object*)
|
||||
doERR_NOMEMORY : UINT := 20603; (*no memory available for module to be created*)
|
||||
doERR_ILLSTATE : UINT := 20611; (*incorrect state of the data object*)
|
||||
doERR_BURNINGOBJECT : UINT := 20614; (*error while saving the data object in "Flash" memory*)
|
||||
doERR_MODULDELETE_SYSROM : UINT := 20615; (*a module in SYSROM cannot be deleted*)
|
||||
doSYSROM : USINT := 0; (*SYSROM (SYSTEM FLASH)*)
|
||||
doNO_CS : USINT := 1; (*no cyclic checksum monitoring and no checksum monitoring during installation and booting*)
|
||||
doUSRROM : USINT := 2; (*USERROM (USER FLASH)*)
|
||||
doUSRRAM : USINT := 3; (*USERRAM (target memory for pointer handling)*)
|
||||
doMEMCARD : USINT := 4; (*MEMCARD (only for SG3)*)
|
||||
doFIXRAM : USINT := 5; (*FIXRAM (only for SG3)*)
|
||||
doTEMP : USINT := 65; (*Temporary data object (DRAM, only for SG4)*)
|
||||
END_VAR
|
||||
225
Logical/Libraries/DataObj/SG3/DataObj.h
Normal file
225
Logical/Libraries/DataObj/SG3/DataObj.h
Normal file
@@ -0,0 +1,225 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DATAOBJ_
|
||||
#define _DATAOBJ_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define doTEMP 65U
|
||||
#define doFIXRAM 5U
|
||||
#define doMEMCARD 4U
|
||||
#define doUSRRAM 3U
|
||||
#define doUSRROM 2U
|
||||
#define doNO_CS 1U
|
||||
#define doSYSROM 0U
|
||||
#define doERR_BURNINGOBJECT 20614U
|
||||
#define doERR_ILLSTATE 20611U
|
||||
#define doERR_NOMEMORY 20603U
|
||||
#define doERR_BRINSTALL 20604U
|
||||
#define doERR_DUPOBJECT 20601U
|
||||
#define doERR_ILLOBJECT 20605U
|
||||
#define doERR_WRONGTIME 20610U
|
||||
#define doERR_ILLMEMTYPE 20602U
|
||||
#define doERR_ILLOBJTYPE 20606U
|
||||
#define doERR_WRONGOFFSET 20607U
|
||||
#define doERR_ILLPARAMETER 20600U
|
||||
#define doERR_STARTHANDLER 20612U
|
||||
#define doERR_ILLEGALLENGTH 20608U
|
||||
#define doERR_MODULNOTFOUND 20609U
|
||||
#define doERR_CHECKSUM_WARNING 20630U
|
||||
#define doERR_TOOLONG_MODULNAME 20613U
|
||||
#else
|
||||
_IEC_CONST unsigned char doTEMP = 65U;
|
||||
_IEC_CONST unsigned char doFIXRAM = 5U;
|
||||
_IEC_CONST unsigned char doMEMCARD = 4U;
|
||||
_IEC_CONST unsigned char doUSRRAM = 3U;
|
||||
_IEC_CONST unsigned char doUSRROM = 2U;
|
||||
_IEC_CONST unsigned char doNO_CS = 1U;
|
||||
_IEC_CONST unsigned char doSYSROM = 0U;
|
||||
_IEC_CONST unsigned short doERR_BURNINGOBJECT = 20614U;
|
||||
_IEC_CONST unsigned short doERR_ILLSTATE = 20611U;
|
||||
_IEC_CONST unsigned short doERR_NOMEMORY = 20603U;
|
||||
_IEC_CONST unsigned short doERR_BRINSTALL = 20604U;
|
||||
_IEC_CONST unsigned short doERR_DUPOBJECT = 20601U;
|
||||
_IEC_CONST unsigned short doERR_ILLOBJECT = 20605U;
|
||||
_IEC_CONST unsigned short doERR_WRONGTIME = 20610U;
|
||||
_IEC_CONST unsigned short doERR_ILLMEMTYPE = 20602U;
|
||||
_IEC_CONST unsigned short doERR_ILLOBJTYPE = 20606U;
|
||||
_IEC_CONST unsigned short doERR_WRONGOFFSET = 20607U;
|
||||
_IEC_CONST unsigned short doERR_ILLPARAMETER = 20600U;
|
||||
_IEC_CONST unsigned short doERR_STARTHANDLER = 20612U;
|
||||
_IEC_CONST unsigned short doERR_ILLEGALLENGTH = 20608U;
|
||||
_IEC_CONST unsigned short doERR_MODULNOTFOUND = 20609U;
|
||||
_IEC_CONST unsigned short doERR_CHECKSUM_WARNING = 20630U;
|
||||
_IEC_CONST unsigned short doERR_TOOLONG_MODULNAME = 20613U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct DatObjCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned char grp;
|
||||
unsigned long pName;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
unsigned long pCpyData;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[105];
|
||||
unsigned long i_spare_1;
|
||||
unsigned short i_spare_2;
|
||||
unsigned long i_spare_3;
|
||||
unsigned char i_spare_4;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCreate_typ;
|
||||
|
||||
typedef struct DatObjWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pSource;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjWrite_typ;
|
||||
|
||||
typedef struct DatObjRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pDestination;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjRead_typ;
|
||||
|
||||
typedef struct DatObjDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjDelete_typ;
|
||||
|
||||
typedef struct DatObjMove
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjMove_typ;
|
||||
|
||||
typedef struct DatObjCopy
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pNameTarget;
|
||||
unsigned char MemTypeTarget;
|
||||
unsigned long OptionTarget;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMemNew;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCopy_typ;
|
||||
|
||||
typedef struct DatObjInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
plcdt ChangeDate;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjInfo_typ;
|
||||
|
||||
typedef struct DatObjChangeDate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
plcdt SetDate;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjChangeDate_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void DatObjCreate(struct DatObjCreate* inst);
|
||||
void DatObjWrite(struct DatObjWrite* inst);
|
||||
void DatObjRead(struct DatObjRead* inst);
|
||||
void DatObjDelete(struct DatObjDelete* inst);
|
||||
void DatObjMove(struct DatObjMove* inst);
|
||||
void DatObjCopy(struct DatObjCopy* inst);
|
||||
void DatObjInfo(struct DatObjInfo* inst);
|
||||
void DatObjChangeDate(struct DatObjChangeDate* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DATAOBJ_ */
|
||||
|
||||
|
||||
250
Logical/Libraries/DataObj/SG4/DataObj.h
Normal file
250
Logical/Libraries/DataObj/SG4/DataObj.h
Normal file
@@ -0,0 +1,250 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DATAOBJ_
|
||||
#define _DATAOBJ_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define doTEMP 65U
|
||||
#define doFIXRAM 5U
|
||||
#define doMEMCARD 4U
|
||||
#define doUSRRAM 3U
|
||||
#define doUSRROM 2U
|
||||
#define doNO_CS 1U
|
||||
#define doSYSROM 0U
|
||||
#define doERR_MODULDELETE_SYSROM 20615U
|
||||
#define doERR_BURNINGOBJECT 20614U
|
||||
#define doERR_ILLSTATE 20611U
|
||||
#define doERR_NOMEMORY 20603U
|
||||
#define doERR_BRINSTALL 20604U
|
||||
#define doERR_DUPOBJECT 20601U
|
||||
#define doERR_ILLOBJECT 20605U
|
||||
#define doERR_WRONGTIME 20610U
|
||||
#define doERR_ILLMEMTYPE 20602U
|
||||
#define doERR_ILLOBJTYPE 20606U
|
||||
#define doERR_WRONGOFFSET 20607U
|
||||
#define doERR_ILLPARAMETER 20600U
|
||||
#define doERR_STARTHANDLER 20612U
|
||||
#define doERR_ILLEGALLENGTH 20608U
|
||||
#define doERR_MODULNOTFOUND 20609U
|
||||
#define doERR_CHECKSUM_WARNING 20630U
|
||||
#define doERR_TOOLONG_MODULNAME 20613U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned char doTEMP;
|
||||
_GLOBAL_CONST unsigned char doFIXRAM;
|
||||
_GLOBAL_CONST unsigned char doMEMCARD;
|
||||
_GLOBAL_CONST unsigned char doUSRRAM;
|
||||
_GLOBAL_CONST unsigned char doUSRROM;
|
||||
_GLOBAL_CONST unsigned char doNO_CS;
|
||||
_GLOBAL_CONST unsigned char doSYSROM;
|
||||
_GLOBAL_CONST unsigned short doERR_MODULDELETE_SYSROM;
|
||||
_GLOBAL_CONST unsigned short doERR_BURNINGOBJECT;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLSTATE;
|
||||
_GLOBAL_CONST unsigned short doERR_NOMEMORY;
|
||||
_GLOBAL_CONST unsigned short doERR_BRINSTALL;
|
||||
_GLOBAL_CONST unsigned short doERR_DUPOBJECT;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLOBJECT;
|
||||
_GLOBAL_CONST unsigned short doERR_WRONGTIME;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLMEMTYPE;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLOBJTYPE;
|
||||
_GLOBAL_CONST unsigned short doERR_WRONGOFFSET;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLPARAMETER;
|
||||
_GLOBAL_CONST unsigned short doERR_STARTHANDLER;
|
||||
_GLOBAL_CONST unsigned short doERR_ILLEGALLENGTH;
|
||||
_GLOBAL_CONST unsigned short doERR_MODULNOTFOUND;
|
||||
_GLOBAL_CONST unsigned short doERR_CHECKSUM_WARNING;
|
||||
_GLOBAL_CONST unsigned short doERR_TOOLONG_MODULNAME;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct DatObjCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned char grp;
|
||||
unsigned long pName;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
unsigned long pCpyData;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[105];
|
||||
unsigned long i_spare_1;
|
||||
unsigned short i_spare_2;
|
||||
unsigned long i_spare_3;
|
||||
unsigned char i_spare_4;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCreate_typ;
|
||||
|
||||
typedef struct DatObjWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pSource;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjWrite_typ;
|
||||
|
||||
typedef struct DatObjRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pDestination;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjRead_typ;
|
||||
|
||||
typedef struct DatObjDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjDelete_typ;
|
||||
|
||||
typedef struct DatObjMove
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjMove_typ;
|
||||
|
||||
typedef struct DatObjCopy
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pNameTarget;
|
||||
unsigned char MemTypeTarget;
|
||||
unsigned long OptionTarget;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMemNew;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCopy_typ;
|
||||
|
||||
typedef struct DatObjInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
plcdt ChangeDate;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjInfo_typ;
|
||||
|
||||
typedef struct DatObjChangeDate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
plcdt SetDate;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjChangeDate_typ;
|
||||
|
||||
typedef struct DatObjAttach
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjAttach_typ;
|
||||
|
||||
typedef struct DatObjDetach
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjDetach_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void DatObjCreate(struct DatObjCreate* inst);
|
||||
_BUR_PUBLIC void DatObjWrite(struct DatObjWrite* inst);
|
||||
_BUR_PUBLIC void DatObjRead(struct DatObjRead* inst);
|
||||
_BUR_PUBLIC void DatObjDelete(struct DatObjDelete* inst);
|
||||
_BUR_PUBLIC void DatObjMove(struct DatObjMove* inst);
|
||||
_BUR_PUBLIC void DatObjCopy(struct DatObjCopy* inst);
|
||||
_BUR_PUBLIC void DatObjInfo(struct DatObjInfo* inst);
|
||||
_BUR_PUBLIC void DatObjChangeDate(struct DatObjChangeDate* inst);
|
||||
_BUR_PUBLIC void DatObjAttach(struct DatObjAttach* inst);
|
||||
_BUR_PUBLIC void DatObjDetach(struct DatObjDetach* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DATAOBJ_ */
|
||||
|
||||
225
Logical/Libraries/DataObj/SGC/DataObj.h
Normal file
225
Logical/Libraries/DataObj/SGC/DataObj.h
Normal file
@@ -0,0 +1,225 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DATAOBJ_
|
||||
#define _DATAOBJ_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define doTEMP 65U
|
||||
#define doFIXRAM 5U
|
||||
#define doMEMCARD 4U
|
||||
#define doUSRRAM 3U
|
||||
#define doUSRROM 2U
|
||||
#define doNO_CS 1U
|
||||
#define doSYSROM 0U
|
||||
#define doERR_BURNINGOBJECT 20614U
|
||||
#define doERR_ILLSTATE 20611U
|
||||
#define doERR_NOMEMORY 20603U
|
||||
#define doERR_BRINSTALL 20604U
|
||||
#define doERR_DUPOBJECT 20601U
|
||||
#define doERR_ILLOBJECT 20605U
|
||||
#define doERR_WRONGTIME 20610U
|
||||
#define doERR_ILLMEMTYPE 20602U
|
||||
#define doERR_ILLOBJTYPE 20606U
|
||||
#define doERR_WRONGOFFSET 20607U
|
||||
#define doERR_ILLPARAMETER 20600U
|
||||
#define doERR_STARTHANDLER 20612U
|
||||
#define doERR_ILLEGALLENGTH 20608U
|
||||
#define doERR_MODULNOTFOUND 20609U
|
||||
#define doERR_CHECKSUM_WARNING 20630U
|
||||
#define doERR_TOOLONG_MODULNAME 20613U
|
||||
#else
|
||||
_IEC_CONST unsigned char doTEMP = 65U;
|
||||
_IEC_CONST unsigned char doFIXRAM = 5U;
|
||||
_IEC_CONST unsigned char doMEMCARD = 4U;
|
||||
_IEC_CONST unsigned char doUSRRAM = 3U;
|
||||
_IEC_CONST unsigned char doUSRROM = 2U;
|
||||
_IEC_CONST unsigned char doNO_CS = 1U;
|
||||
_IEC_CONST unsigned char doSYSROM = 0U;
|
||||
_IEC_CONST unsigned short doERR_BURNINGOBJECT = 20614U;
|
||||
_IEC_CONST unsigned short doERR_ILLSTATE = 20611U;
|
||||
_IEC_CONST unsigned short doERR_NOMEMORY = 20603U;
|
||||
_IEC_CONST unsigned short doERR_BRINSTALL = 20604U;
|
||||
_IEC_CONST unsigned short doERR_DUPOBJECT = 20601U;
|
||||
_IEC_CONST unsigned short doERR_ILLOBJECT = 20605U;
|
||||
_IEC_CONST unsigned short doERR_WRONGTIME = 20610U;
|
||||
_IEC_CONST unsigned short doERR_ILLMEMTYPE = 20602U;
|
||||
_IEC_CONST unsigned short doERR_ILLOBJTYPE = 20606U;
|
||||
_IEC_CONST unsigned short doERR_WRONGOFFSET = 20607U;
|
||||
_IEC_CONST unsigned short doERR_ILLPARAMETER = 20600U;
|
||||
_IEC_CONST unsigned short doERR_STARTHANDLER = 20612U;
|
||||
_IEC_CONST unsigned short doERR_ILLEGALLENGTH = 20608U;
|
||||
_IEC_CONST unsigned short doERR_MODULNOTFOUND = 20609U;
|
||||
_IEC_CONST unsigned short doERR_CHECKSUM_WARNING = 20630U;
|
||||
_IEC_CONST unsigned short doERR_TOOLONG_MODULNAME = 20613U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct DatObjCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned char grp;
|
||||
unsigned long pName;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
unsigned long pCpyData;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[105];
|
||||
unsigned long i_spare_1;
|
||||
unsigned short i_spare_2;
|
||||
unsigned long i_spare_3;
|
||||
unsigned char i_spare_4;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCreate_typ;
|
||||
|
||||
typedef struct DatObjWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pSource;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjWrite_typ;
|
||||
|
||||
typedef struct DatObjRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long Offset;
|
||||
unsigned long pDestination;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjRead_typ;
|
||||
|
||||
typedef struct DatObjDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjDelete_typ;
|
||||
|
||||
typedef struct DatObjMove
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMem;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjMove_typ;
|
||||
|
||||
typedef struct DatObjCopy
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pNameTarget;
|
||||
unsigned char MemTypeTarget;
|
||||
unsigned long OptionTarget;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long identNew;
|
||||
unsigned long pDatObjMemNew;
|
||||
/* VAR (analog) */
|
||||
unsigned long i_state;
|
||||
unsigned long i_result;
|
||||
unsigned char i_spare[41];
|
||||
unsigned long i_spare_1;
|
||||
unsigned char i_spare_2;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjCopy_typ;
|
||||
|
||||
typedef struct DatObjInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long pDatObjMem;
|
||||
unsigned long len;
|
||||
unsigned char MemType;
|
||||
unsigned long Option;
|
||||
plcdt ChangeDate;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjInfo_typ;
|
||||
|
||||
typedef struct DatObjChangeDate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
plcdt SetDate;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DatObjChangeDate_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void DatObjCreate(struct DatObjCreate* inst);
|
||||
void DatObjWrite(struct DatObjWrite* inst);
|
||||
void DatObjRead(struct DatObjRead* inst);
|
||||
void DatObjDelete(struct DatObjDelete* inst);
|
||||
void DatObjMove(struct DatObjMove* inst);
|
||||
void DatObjCopy(struct DatObjCopy* inst);
|
||||
void DatObjInfo(struct DatObjInfo* inst);
|
||||
void DatObjChangeDate(struct DatObjChangeDate* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DATAOBJ_ */
|
||||
|
||||
|
||||
12
Logical/Libraries/DataObj/binary.lby
Normal file
12
Logical/Libraries/DataObj/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The DataObj library can be used to dynamically create, dynamically delete and copy data objects, etc. " xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>DataObj.fun</File>
|
||||
<File>DataObj.typ</File>
|
||||
<File>DataObj.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
561
Logical/Libraries/FileIO/FileIO.fun
Normal file
561
Logical/Libraries/FileIO/FileIO.fun
Normal file
@@ -0,0 +1,561 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCreate (*creates a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pFile : UDINT; (*pointer to the file name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileOpen (*opens a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pFile : UDINT; (*pointer to the file name*)
|
||||
mode : USINT; (*access mode (FILE_R, FILE_W, FILE_RW)*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
filelen : UDINT; (*file length*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileClose (*closes an open file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRead (*reads from an open file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
offset : UDINT; (*offset*)
|
||||
pDest : UDINT; (*pointer to the read buffer*)
|
||||
len : UDINT; (*length of bytes to read*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileReadEx (*reads from an open file and returns the number of actually read bytes; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
offset : UDINT; (*offset*)
|
||||
pDest : UDINT; (*pointer to the read buffer*)
|
||||
len : UDINT; (*number of bytes to read*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
bytesread : UDINT; (*number of bytes read*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWrite (*writes to a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
offset : UDINT; (*offset*)
|
||||
pSrc : UDINT; (*pointer to the write buffer*)
|
||||
len : UDINT; (*number of bytes to write*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileWriteEx (*writes to a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the created file*)
|
||||
offset : UDINT; (*offset*)
|
||||
pSrc : UDINT; (*pointer to the write buffer*)
|
||||
len : UDINT; (*number of bytes to write*)
|
||||
option : UDINT; (*options*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileRename (*renames files; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the file name*)
|
||||
pNewName : UDINT; (*pointer to the new file name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileCopy (*copies a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pSrcDev : UDINT; (*pointer to the source file device name*)
|
||||
pSrc : UDINT; (*pointer to the existing file name*)
|
||||
pDestDev : UDINT; (*pointer to the destination file device name*)
|
||||
pDest : UDINT; (*pointer to the copy file name*)
|
||||
option : USINT; (*copy option*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileDelete (*deletes a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the file name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileInfo (*gets information about a file; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*file name given as pointer*)
|
||||
pInfo : UDINT; (*file information (fiFILE_INFO) structure given as pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FileTruncate (*truncates a file's length; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*file name given as pointer*)
|
||||
newLength : UDINT; (*new length*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCreate (*creates a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the directory name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirOpen (*opens a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the directory name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*identifier of the directory*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirClose (*closes a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the directory*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRead (*reads the individual file names in a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pPath : UDINT; (*pointer to the path string*)
|
||||
entry : UDINT; (*specifies which entry should be read*)
|
||||
option : USINT; (*specifies whether directory names or filenames should be read*)
|
||||
pData : UDINT; (*pointer to the memory area where the information is copied*)
|
||||
data_len : UDINT; (*length of the provided data area*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirReadEx (*reads the individual file or directory names in a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*identifier of the directory*)
|
||||
pData : UDINT; (*pointer to the memory area where the information is copied*)
|
||||
data_len : UDINT; (*length of the available data area*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirInfo (*gets information about a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pPath : UDINT; (*pointer to the path (directory name)*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
dirnum : UDINT; (*number of subdirectories in this directory*)
|
||||
filenum : UDINT; (*number of files in this directory*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirRename (*renames directories; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the directory name*)
|
||||
pNewName : UDINT; (*pointer to the new directory name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirCopy (*copies a directory*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pSrcDev : UDINT; (*pointer to the source file device name*)
|
||||
pSrcDir : UDINT; (*pointer to the source directory name*)
|
||||
pDestDev : UDINT; (*pointer to the destination file device name*)
|
||||
pDestDir : UDINT; (*pointer to the destination directory name*)
|
||||
option : USINT; (*copy option*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDelete (*deletes a directory; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the directory name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DirDeleteEx (*deletes a directory (all files and subdirectories); asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pName : UDINT; (*pointer to the directory name*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK SetAttributes (*sets attributes; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pPath : UDINT; (*pointer to the path name (file or directory)*)
|
||||
attributes : USINT; (*attributes*)
|
||||
option : USINT; (*set options*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetAttributes (*reads attributes; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pPath : UDINT; (*pointer to the path name (file or directory)*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
attributes : USINT; (*attributes*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevMemInfo (*determines a file device's memory information; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
freemem : UDINT; (*available disk space*)
|
||||
memsize : UDINT; (*total disk space*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevLink (*creates the file device; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*new device name given as a pointer*)
|
||||
pParam : UDINT; (*pointer to the link parameter*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
handle : UDINT; (*file device handle*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DevUnlink (*unlinks the device; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
handle : UDINT; (*file device handle*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeLabel (*reads volume label; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
pLabel : UDINT; (*buffer for volume label given as pointer*)
|
||||
labelMax : UDINT; (*size of buffer for volume label*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
labelLen : UDINT; (*length of volume label*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK GetVolumeSerialNo (*reads volume serial nummer; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pDevice : UDINT; (*device name given as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
i_state : UINT; (*internal variable*)
|
||||
i_result : UINT; (*internal variable*)
|
||||
i_tmp : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
serialNo : UDINT; (*volume serialNo*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION FileIoGetSysError : UINT (*reads system errors*)
|
||||
END_FUNCTION
|
||||
24
Logical/Libraries/FileIO/FileIO.typ
Normal file
24
Logical/Libraries/FileIO/FileIO.typ
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
TYPE
|
||||
fiDIR_READ_DATA : STRUCT (*directory read structure*)
|
||||
Filename : ARRAY[0..259] OF USINT; (*file name*)
|
||||
Date : DATE_AND_TIME; (*date and time*)
|
||||
Filelength : UDINT; (*file length*)
|
||||
END_STRUCT;
|
||||
|
||||
fiDIR_READ_EX_DATA : STRUCT (*directory read extended structure*)
|
||||
Filename : ARRAY[0..259] OF USINT; (*file name*)
|
||||
Date : DATE_AND_TIME; (*date and time*)
|
||||
Filelength : UDINT; (*file length*)
|
||||
Mode : UINT; (*mode*)
|
||||
END_STRUCT;
|
||||
|
||||
fiFILE_INFO : STRUCT (*file information structure*)
|
||||
size : UDINT; (*size of file [bytes]*)
|
||||
linkCnt : UDINT; (*link count*)
|
||||
accTime : DATE_AND_TIME; (*time of last access*)
|
||||
modTime : DATE_AND_TIME; (*time of last data modification*)
|
||||
chgTime : DATE_AND_TIME; (*time of last file status change*)
|
||||
reserved : ARRAY[0..20] OF UDINT; (*reserved for future use*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
85
Logical/Libraries/FileIO/FileIO.var
Normal file
85
Logical/Libraries/FileIO/FileIO.var
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
VAR CONSTANT
|
||||
fiATTR_ARCHIVE : USINT := 32; (*attribute archive*)
|
||||
fiATTR_DIRECTORY : USINT := 16; (*attribute directory*)
|
||||
fiATTR_HIDDEN : USINT := 2; (*attribute hidden*)
|
||||
fiATTR_RDONLY : USINT := 1; (*attribute read only*)
|
||||
fiATTR_SYSTEM : USINT := 4; (*attribute system*)
|
||||
fiATTR_VOL_LABEL : USINT := 8; (*attribute volume label*)
|
||||
|
||||
fiRECURSIVE : USINT := 1; (*option recursive*)
|
||||
fiOVERWRITE : USINT := 2; (*option overwrite*)
|
||||
|
||||
fiREAD_ONLY : USINT := 0; (*access mode read only*)
|
||||
fiWRITE_ONLY : USINT := 1; (*access mode write only*)
|
||||
fiREAD_WRITE : USINT := 2; (*access mode read and write*)
|
||||
|
||||
fiFILE : USINT := 0; (*directory read files only*)
|
||||
fiDIRECTORY : USINT := 1; (*directory read directories only*)
|
||||
fiBOTH : USINT := 2; (*directory read files and directories*)
|
||||
|
||||
fiTruncate : UDINT := 1; (*truncate file*)
|
||||
|
||||
fiERR_INVALID_PATH : UINT := 20700; (*error invalid path*)
|
||||
fiERR_DATA_SIZE : UINT := 20701; (*error data size*)
|
||||
fiERR_NO_MORE_ENTRIES : UINT := 20702; (*error no more entries*)
|
||||
fiERR_NOT_SUPPORTED : UINT := 20703; (*error not supported*)
|
||||
fiERR_INVALID_TYP : UINT := 20704; (*error invalid type*)
|
||||
fiERR_EXIST : UINT := 20705; (*error exist*)
|
||||
fiERR_ACCESS : UINT := 20706; (*error access*)
|
||||
fiERR_MODE : UINT := 20707; (*error mode*)
|
||||
fiERR_FILE_NOT_FOUND : UINT := 20708; (*error file not found*)
|
||||
fiERR_FILE_DEVICE : UINT := 20709; (*error file device*)
|
||||
fiERR_SPACE : UINT := 20710; (*error space*)
|
||||
fiERR_SEEK : UINT := 20711; (*error seek*)
|
||||
fiERR_FILE : UINT := 20712; (*error file*)
|
||||
fiERR_LESS_VIRTUAL_MEMORY : UINT := 20713; (*error less virtual memory*)
|
||||
fiERR_COM_FILE_OPEN : UINT := 20714; (*error file open*)
|
||||
fiERR_COM_FILE_CLOSE : UINT := 20715; (*error file close*)
|
||||
fiERR_COM_FILE_READ : UINT := 20716; (*error file read*)
|
||||
fiERR_COM_FILE_WRITE : UINT := 20717; (*error file write*)
|
||||
fiERR_COM_FILE_IOCTL : UINT := 20718; (*error fiel ioctl*)
|
||||
fiERR_DATA : UINT := 20719; (*error data*)
|
||||
fiERR_ASYNC_MANAGER : UINT := 20720; (*error asynchron manager*)
|
||||
fiERR_FILE_NOT_OPENED : UINT := 20721; (*error file not opened*)
|
||||
fiERR_INVALID_DIRECTORY : UINT := 20722; (*error invalid directory*)
|
||||
fiERR_DIR_NOT_EXIST : UINT := 20723; (*error directory not exists*)
|
||||
fiERR_DIR_NOT_EMPTY : UINT := 20724; (*error directory not empty*)
|
||||
fiERR_DIR_ALREADY_EXIST : UINT := 20725; (*error directory already exists*)
|
||||
fiERR_DETMEMINFO : UINT := 20726; (*error dedect memory info*)
|
||||
fiERR_NOT_ENOUGH_FREEMEM : UINT := 20727; (*error not enough free memory*)
|
||||
fiERR_DIR_INVALID_HANDLE : UINT := 20728; (*error invalid directory handle*)
|
||||
fiERR_PARAMETER : UINT := 20729; (*error parameter*)
|
||||
fiERR_DEVICE_ALREADY_EXIST : UINT := 20730; (*error device already exists*)
|
||||
fiERR_DEVICE_INVALID_HANDLE : UINT := 20731; (*error invalid device handle*)
|
||||
fiERR_NETIO_IP_UNEQUAL : UINT := 20732; (*ungleiche IP bei identischem Hostnamen - IP-overwrite nicht gesetzt*)
|
||||
fiERR_NETIO_PORT : UINT := 20733; (*error port not supported*)
|
||||
fiERR_NETIO_USER : UINT := 20734; (*error user or password*)
|
||||
fiERR_INVALID_NBYTES : UINT := 20735; (*error invalid number of bytes*)
|
||||
fiERR_NETIO_PARAMETERS : UINT := 20736; (*error invalid parameters to establish a connection*)
|
||||
|
||||
fiERR_INIT : UINT := 20796; (*error init*)
|
||||
fiERR_DEVICE_DRIVER : UINT := 20797; (*error device driver*)
|
||||
fiERR_DEVICE_MANAGER : UINT := 20798; (*error device manager*)
|
||||
fiERR_SYSTEM : UINT := 20799; (*error system*)
|
||||
|
||||
|
||||
ATTR_ARCHIVE : USINT := 32; (*obsolete*)
|
||||
ATTR_DIRECTORY : USINT := 16; (*obsolete*)
|
||||
ATTR_HIDDEN : USINT := 2; (*obsolete*)
|
||||
ATTR_RDONLY : USINT := 1; (*obsolete*)
|
||||
ATTR_SYSTEM : USINT := 4; (*obsolete*)
|
||||
ATTR_VOL_LABEL : USINT := 8; (*obsolete*)
|
||||
DIR_OW : USINT := 1; (*obsolete*)
|
||||
FILE_ALL : USINT := 2; (*obsolete*)
|
||||
FILE_DIR : USINT := 1; (*obsolete*)
|
||||
FILE_FILE : USINT := 0; (*obsolete*)
|
||||
FILE_ONCE : USINT := 0; (*obsolete*)
|
||||
FILE_DETMEM : USINT := 1; (*obsolete*)
|
||||
FILE_OW_DETMEM : USINT := 2; (*obsolete*)
|
||||
FILE_OW_ONCE : USINT := 3; (*obsolete*)
|
||||
FILE_R : USINT := 0; (*obsolete*)
|
||||
FILE_W : USINT := 1; (*obsolete*)
|
||||
FILE_RW : USINT := 2; (*obsolete*)
|
||||
SET_RECURSIVE : USINT := 1; (*obsolete*)
|
||||
END_VAR
|
||||
710
Logical/Libraries/FileIO/SG4/FileIO.h
Normal file
710
Logical/Libraries/FileIO/SG4/FileIO.h
Normal file
@@ -0,0 +1,710 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _FILEIO_
|
||||
#define _FILEIO_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define SET_RECURSIVE 1U
|
||||
#define FILE_RW 2U
|
||||
#define FILE_W 1U
|
||||
#define FILE_R 0U
|
||||
#define FILE_OW_ONCE 3U
|
||||
#define FILE_OW_DETMEM 2U
|
||||
#define FILE_DETMEM 1U
|
||||
#define FILE_ONCE 0U
|
||||
#define FILE_FILE 0U
|
||||
#define FILE_DIR 1U
|
||||
#define FILE_ALL 2U
|
||||
#define DIR_OW 1U
|
||||
#define ATTR_VOL_LABEL 8U
|
||||
#define ATTR_SYSTEM 4U
|
||||
#define ATTR_RDONLY 1U
|
||||
#define ATTR_HIDDEN 2U
|
||||
#define ATTR_DIRECTORY 16U
|
||||
#define ATTR_ARCHIVE 32U
|
||||
#define fiERR_SYSTEM 20799U
|
||||
#define fiERR_DEVICE_MANAGER 20798U
|
||||
#define fiERR_DEVICE_DRIVER 20797U
|
||||
#define fiERR_INIT 20796U
|
||||
#define fiERR_NETIO_PARAMETERS 20736U
|
||||
#define fiERR_INVALID_NBYTES 20735U
|
||||
#define fiERR_NETIO_USER 20734U
|
||||
#define fiERR_NETIO_PORT 20733U
|
||||
#define fiERR_NETIO_IP_UNEQUAL 20732U
|
||||
#define fiERR_DEVICE_INVALID_HANDLE 20731U
|
||||
#define fiERR_DEVICE_ALREADY_EXIST 20730U
|
||||
#define fiERR_PARAMETER 20729U
|
||||
#define fiERR_DIR_INVALID_HANDLE 20728U
|
||||
#define fiERR_NOT_ENOUGH_FREEMEM 20727U
|
||||
#define fiERR_DETMEMINFO 20726U
|
||||
#define fiERR_DIR_ALREADY_EXIST 20725U
|
||||
#define fiERR_DIR_NOT_EMPTY 20724U
|
||||
#define fiERR_DIR_NOT_EXIST 20723U
|
||||
#define fiERR_INVALID_DIRECTORY 20722U
|
||||
#define fiERR_FILE_NOT_OPENED 20721U
|
||||
#define fiERR_ASYNC_MANAGER 20720U
|
||||
#define fiERR_DATA 20719U
|
||||
#define fiERR_COM_FILE_IOCTL 20718U
|
||||
#define fiERR_COM_FILE_WRITE 20717U
|
||||
#define fiERR_COM_FILE_READ 20716U
|
||||
#define fiERR_COM_FILE_CLOSE 20715U
|
||||
#define fiERR_COM_FILE_OPEN 20714U
|
||||
#define fiERR_LESS_VIRTUAL_MEMORY 20713U
|
||||
#define fiERR_FILE 20712U
|
||||
#define fiERR_SEEK 20711U
|
||||
#define fiERR_SPACE 20710U
|
||||
#define fiERR_FILE_DEVICE 20709U
|
||||
#define fiERR_FILE_NOT_FOUND 20708U
|
||||
#define fiERR_MODE 20707U
|
||||
#define fiERR_ACCESS 20706U
|
||||
#define fiERR_EXIST 20705U
|
||||
#define fiERR_INVALID_TYP 20704U
|
||||
#define fiERR_NOT_SUPPORTED 20703U
|
||||
#define fiERR_NO_MORE_ENTRIES 20702U
|
||||
#define fiERR_DATA_SIZE 20701U
|
||||
#define fiERR_INVALID_PATH 20700U
|
||||
#define fiTruncate 1U
|
||||
#define fiBOTH 2U
|
||||
#define fiDIRECTORY 1U
|
||||
#define fiFILE 0U
|
||||
#define fiREAD_WRITE 2U
|
||||
#define fiWRITE_ONLY 1U
|
||||
#define fiREAD_ONLY 0U
|
||||
#define fiOVERWRITE 2U
|
||||
#define fiRECURSIVE 1U
|
||||
#define fiATTR_VOL_LABEL 8U
|
||||
#define fiATTR_SYSTEM 4U
|
||||
#define fiATTR_RDONLY 1U
|
||||
#define fiATTR_HIDDEN 2U
|
||||
#define fiATTR_DIRECTORY 16U
|
||||
#define fiATTR_ARCHIVE 32U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned char SET_RECURSIVE;
|
||||
_GLOBAL_CONST unsigned char FILE_RW;
|
||||
_GLOBAL_CONST unsigned char FILE_W;
|
||||
_GLOBAL_CONST unsigned char FILE_R;
|
||||
_GLOBAL_CONST unsigned char FILE_OW_ONCE;
|
||||
_GLOBAL_CONST unsigned char FILE_OW_DETMEM;
|
||||
_GLOBAL_CONST unsigned char FILE_DETMEM;
|
||||
_GLOBAL_CONST unsigned char FILE_ONCE;
|
||||
_GLOBAL_CONST unsigned char FILE_FILE;
|
||||
_GLOBAL_CONST unsigned char FILE_DIR;
|
||||
_GLOBAL_CONST unsigned char FILE_ALL;
|
||||
_GLOBAL_CONST unsigned char DIR_OW;
|
||||
_GLOBAL_CONST unsigned char ATTR_VOL_LABEL;
|
||||
_GLOBAL_CONST unsigned char ATTR_SYSTEM;
|
||||
_GLOBAL_CONST unsigned char ATTR_RDONLY;
|
||||
_GLOBAL_CONST unsigned char ATTR_HIDDEN;
|
||||
_GLOBAL_CONST unsigned char ATTR_DIRECTORY;
|
||||
_GLOBAL_CONST unsigned char ATTR_ARCHIVE;
|
||||
_GLOBAL_CONST unsigned short fiERR_SYSTEM;
|
||||
_GLOBAL_CONST unsigned short fiERR_DEVICE_MANAGER;
|
||||
_GLOBAL_CONST unsigned short fiERR_DEVICE_DRIVER;
|
||||
_GLOBAL_CONST unsigned short fiERR_INIT;
|
||||
_GLOBAL_CONST unsigned short fiERR_NETIO_PARAMETERS;
|
||||
_GLOBAL_CONST unsigned short fiERR_INVALID_NBYTES;
|
||||
_GLOBAL_CONST unsigned short fiERR_NETIO_USER;
|
||||
_GLOBAL_CONST unsigned short fiERR_NETIO_PORT;
|
||||
_GLOBAL_CONST unsigned short fiERR_NETIO_IP_UNEQUAL;
|
||||
_GLOBAL_CONST unsigned short fiERR_DEVICE_INVALID_HANDLE;
|
||||
_GLOBAL_CONST unsigned short fiERR_DEVICE_ALREADY_EXIST;
|
||||
_GLOBAL_CONST unsigned short fiERR_PARAMETER;
|
||||
_GLOBAL_CONST unsigned short fiERR_DIR_INVALID_HANDLE;
|
||||
_GLOBAL_CONST unsigned short fiERR_NOT_ENOUGH_FREEMEM;
|
||||
_GLOBAL_CONST unsigned short fiERR_DETMEMINFO;
|
||||
_GLOBAL_CONST unsigned short fiERR_DIR_ALREADY_EXIST;
|
||||
_GLOBAL_CONST unsigned short fiERR_DIR_NOT_EMPTY;
|
||||
_GLOBAL_CONST unsigned short fiERR_DIR_NOT_EXIST;
|
||||
_GLOBAL_CONST unsigned short fiERR_INVALID_DIRECTORY;
|
||||
_GLOBAL_CONST unsigned short fiERR_FILE_NOT_OPENED;
|
||||
_GLOBAL_CONST unsigned short fiERR_ASYNC_MANAGER;
|
||||
_GLOBAL_CONST unsigned short fiERR_DATA;
|
||||
_GLOBAL_CONST unsigned short fiERR_COM_FILE_IOCTL;
|
||||
_GLOBAL_CONST unsigned short fiERR_COM_FILE_WRITE;
|
||||
_GLOBAL_CONST unsigned short fiERR_COM_FILE_READ;
|
||||
_GLOBAL_CONST unsigned short fiERR_COM_FILE_CLOSE;
|
||||
_GLOBAL_CONST unsigned short fiERR_COM_FILE_OPEN;
|
||||
_GLOBAL_CONST unsigned short fiERR_LESS_VIRTUAL_MEMORY;
|
||||
_GLOBAL_CONST unsigned short fiERR_FILE;
|
||||
_GLOBAL_CONST unsigned short fiERR_SEEK;
|
||||
_GLOBAL_CONST unsigned short fiERR_SPACE;
|
||||
_GLOBAL_CONST unsigned short fiERR_FILE_DEVICE;
|
||||
_GLOBAL_CONST unsigned short fiERR_FILE_NOT_FOUND;
|
||||
_GLOBAL_CONST unsigned short fiERR_MODE;
|
||||
_GLOBAL_CONST unsigned short fiERR_ACCESS;
|
||||
_GLOBAL_CONST unsigned short fiERR_EXIST;
|
||||
_GLOBAL_CONST unsigned short fiERR_INVALID_TYP;
|
||||
_GLOBAL_CONST unsigned short fiERR_NOT_SUPPORTED;
|
||||
_GLOBAL_CONST unsigned short fiERR_NO_MORE_ENTRIES;
|
||||
_GLOBAL_CONST unsigned short fiERR_DATA_SIZE;
|
||||
_GLOBAL_CONST unsigned short fiERR_INVALID_PATH;
|
||||
_GLOBAL_CONST unsigned long fiTruncate;
|
||||
_GLOBAL_CONST unsigned char fiBOTH;
|
||||
_GLOBAL_CONST unsigned char fiDIRECTORY;
|
||||
_GLOBAL_CONST unsigned char fiFILE;
|
||||
_GLOBAL_CONST unsigned char fiREAD_WRITE;
|
||||
_GLOBAL_CONST unsigned char fiWRITE_ONLY;
|
||||
_GLOBAL_CONST unsigned char fiREAD_ONLY;
|
||||
_GLOBAL_CONST unsigned char fiOVERWRITE;
|
||||
_GLOBAL_CONST unsigned char fiRECURSIVE;
|
||||
_GLOBAL_CONST unsigned char fiATTR_VOL_LABEL;
|
||||
_GLOBAL_CONST unsigned char fiATTR_SYSTEM;
|
||||
_GLOBAL_CONST unsigned char fiATTR_RDONLY;
|
||||
_GLOBAL_CONST unsigned char fiATTR_HIDDEN;
|
||||
_GLOBAL_CONST unsigned char fiATTR_DIRECTORY;
|
||||
_GLOBAL_CONST unsigned char fiATTR_ARCHIVE;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct fiDIR_READ_DATA
|
||||
{ unsigned char Filename[260];
|
||||
plcdt Date;
|
||||
unsigned long Filelength;
|
||||
} fiDIR_READ_DATA;
|
||||
|
||||
typedef struct fiDIR_READ_EX_DATA
|
||||
{ unsigned char Filename[260];
|
||||
plcdt Date;
|
||||
unsigned long Filelength;
|
||||
unsigned short Mode;
|
||||
} fiDIR_READ_EX_DATA;
|
||||
|
||||
typedef struct fiFILE_INFO
|
||||
{ unsigned long size;
|
||||
unsigned long linkCnt;
|
||||
plcdt accTime;
|
||||
plcdt modTime;
|
||||
plcdt chgTime;
|
||||
unsigned long reserved[21];
|
||||
} fiFILE_INFO;
|
||||
|
||||
typedef struct FileCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pFile;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileCreate_typ;
|
||||
|
||||
typedef struct FileOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pFile;
|
||||
unsigned char mode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long filelen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileOpen_typ;
|
||||
|
||||
typedef struct FileClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileClose_typ;
|
||||
|
||||
typedef struct FileRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long offset;
|
||||
unsigned long pDest;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileRead_typ;
|
||||
|
||||
typedef struct FileReadEx
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long offset;
|
||||
unsigned long pDest;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long bytesread;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileReadEx_typ;
|
||||
|
||||
typedef struct FileWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long offset;
|
||||
unsigned long pSrc;
|
||||
unsigned long len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileWrite_typ;
|
||||
|
||||
typedef struct FileWriteEx
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long offset;
|
||||
unsigned long pSrc;
|
||||
unsigned long len;
|
||||
unsigned long option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileWriteEx_typ;
|
||||
|
||||
typedef struct FileRename
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
unsigned long pNewName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileRename_typ;
|
||||
|
||||
typedef struct FileCopy
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pSrcDev;
|
||||
unsigned long pSrc;
|
||||
unsigned long pDestDev;
|
||||
unsigned long pDest;
|
||||
unsigned char option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileCopy_typ;
|
||||
|
||||
typedef struct FileDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileDelete_typ;
|
||||
|
||||
typedef struct FileInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
unsigned long pInfo;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileInfo_typ;
|
||||
|
||||
typedef struct FileTruncate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
unsigned long newLength;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FileTruncate_typ;
|
||||
|
||||
typedef struct DirCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirCreate_typ;
|
||||
|
||||
typedef struct DirOpen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirOpen_typ;
|
||||
|
||||
typedef struct DirClose
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirClose_typ;
|
||||
|
||||
typedef struct DirRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pPath;
|
||||
unsigned long entry;
|
||||
unsigned char option;
|
||||
unsigned long pData;
|
||||
unsigned long data_len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirRead_typ;
|
||||
|
||||
typedef struct DirReadEx
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long pData;
|
||||
unsigned long data_len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirReadEx_typ;
|
||||
|
||||
typedef struct DirInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pPath;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long dirnum;
|
||||
unsigned long filenum;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirInfo_typ;
|
||||
|
||||
typedef struct DirRename
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
unsigned long pNewName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirRename_typ;
|
||||
|
||||
typedef struct DirCopy
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pSrcDev;
|
||||
unsigned long pSrcDir;
|
||||
unsigned long pDestDev;
|
||||
unsigned long pDestDir;
|
||||
unsigned char option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirCopy_typ;
|
||||
|
||||
typedef struct DirDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirDelete_typ;
|
||||
|
||||
typedef struct DirDeleteEx
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DirDeleteEx_typ;
|
||||
|
||||
typedef struct SetAttributes
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pPath;
|
||||
unsigned char attributes;
|
||||
unsigned char option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} SetAttributes_typ;
|
||||
|
||||
typedef struct GetAttributes
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pPath;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned char attributes;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} GetAttributes_typ;
|
||||
|
||||
typedef struct DevMemInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long freemem;
|
||||
unsigned long memsize;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DevMemInfo_typ;
|
||||
|
||||
typedef struct DevLink
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pParam;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long handle;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DevLink_typ;
|
||||
|
||||
typedef struct DevUnlink
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long handle;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DevUnlink_typ;
|
||||
|
||||
typedef struct GetVolumeLabel
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
unsigned long pLabel;
|
||||
unsigned long labelMax;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long labelLen;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} GetVolumeLabel_typ;
|
||||
|
||||
typedef struct GetVolumeSerialNo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDevice;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long serialNo;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} GetVolumeSerialNo_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void FileCreate(struct FileCreate* inst);
|
||||
_BUR_PUBLIC void FileOpen(struct FileOpen* inst);
|
||||
_BUR_PUBLIC void FileClose(struct FileClose* inst);
|
||||
_BUR_PUBLIC void FileRead(struct FileRead* inst);
|
||||
_BUR_PUBLIC void FileReadEx(struct FileReadEx* inst);
|
||||
_BUR_PUBLIC void FileWrite(struct FileWrite* inst);
|
||||
_BUR_PUBLIC void FileWriteEx(struct FileWriteEx* inst);
|
||||
_BUR_PUBLIC void FileRename(struct FileRename* inst);
|
||||
_BUR_PUBLIC void FileCopy(struct FileCopy* inst);
|
||||
_BUR_PUBLIC void FileDelete(struct FileDelete* inst);
|
||||
_BUR_PUBLIC void FileInfo(struct FileInfo* inst);
|
||||
_BUR_PUBLIC void FileTruncate(struct FileTruncate* inst);
|
||||
_BUR_PUBLIC void DirCreate(struct DirCreate* inst);
|
||||
_BUR_PUBLIC void DirOpen(struct DirOpen* inst);
|
||||
_BUR_PUBLIC void DirClose(struct DirClose* inst);
|
||||
_BUR_PUBLIC void DirRead(struct DirRead* inst);
|
||||
_BUR_PUBLIC void DirReadEx(struct DirReadEx* inst);
|
||||
_BUR_PUBLIC void DirInfo(struct DirInfo* inst);
|
||||
_BUR_PUBLIC void DirRename(struct DirRename* inst);
|
||||
_BUR_PUBLIC void DirCopy(struct DirCopy* inst);
|
||||
_BUR_PUBLIC void DirDelete(struct DirDelete* inst);
|
||||
_BUR_PUBLIC void DirDeleteEx(struct DirDeleteEx* inst);
|
||||
_BUR_PUBLIC void SetAttributes(struct SetAttributes* inst);
|
||||
_BUR_PUBLIC void GetAttributes(struct GetAttributes* inst);
|
||||
_BUR_PUBLIC void DevMemInfo(struct DevMemInfo* inst);
|
||||
_BUR_PUBLIC void DevLink(struct DevLink* inst);
|
||||
_BUR_PUBLIC void DevUnlink(struct DevUnlink* inst);
|
||||
_BUR_PUBLIC void GetVolumeLabel(struct GetVolumeLabel* inst);
|
||||
_BUR_PUBLIC void GetVolumeSerialNo(struct GetVolumeSerialNo* inst);
|
||||
_BUR_PUBLIC unsigned short FileIoGetSysError(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _FILEIO_ */
|
||||
|
||||
12
Logical/Libraries/FileIO/binary.lby
Normal file
12
Logical/Libraries/FileIO/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The FileIO library provides function blocks for file handling." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>FileIO.fun</File>
|
||||
<File>FileIO.typ</File>
|
||||
<File>FileIO.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
18
Logical/Libraries/Package.pkg
Normal file
18
Logical/Libraries/Package.pkg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="Library" Language="binary" Description="This library contains function interfaces for IEC 61131-3 operator functions. For the most part, these are mathematical and logical functions.">operator</Object>
|
||||
<Object Type="Library" Language="binary" Description="This library contains runtime functions for IEC tasks.">runtime</Object>
|
||||
<Object Type="Library" Language="binary" Description="The AsTime Library supports DATE_AND_TIME and TIME data types.">astime</Object>
|
||||
<Object Type="Library" Language="binary" Description="This library contains function interfaces for IEC 61131-3 conversion functions.">AsIecCon</Object>
|
||||
<Object Type="Library" Language="binary" Description="The DRV_mbus library provides functions that allow a B&R System to communicate via Modbus communication.">DRV_mbus</Object>
|
||||
<Object Type="Library" Language="binary" Description="The DVFrame library and the frame driver can be used to exchange data with external devices.">dvframe</Object>
|
||||
<Object Type="Library" Language="binary" Description="The DataObj library can be used to dynamically create, dynamically delete and copy data objects, etc. ">DataObj</Object>
|
||||
<Object Type="Library" Language="binary" Description="This library contains standard function blocks and functions for IEC 61131-3.">standard</Object>
|
||||
<Object Type="Library" Language="binary" Description="The AsBrStr Library contains FBKs for memory and character string handling.">AsBrStr</Object>
|
||||
<Object Type="Library" Language="binary" Description="The FileIO library provides function blocks for file handling.">FileIO</Object>
|
||||
<Object Type="Library" Language="binary" Description="This library contains function blocks to handle USB devices on the target.">AsUSB</Object>
|
||||
<Object Type="Library" Language="binary" Description="This library contains FBKs for sending email over an SMTP (Simple Mail Transfer Protocol) server.">AsSMTP</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
130
Logical/Libraries/astime/SG3/astime.h
Normal file
130
Logical/Libraries/astime/SG3/astime.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTIME_
|
||||
#define _ASTIME_
|
||||
#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 timERR_AR 33213U
|
||||
#define timERR_INVALID_DTSTRUCTURE 33212U
|
||||
#define timERR_INVALID_LEN 33211U
|
||||
#define timERR_INVALID_PARAMETER 33210U
|
||||
#define timTIME_SERVER 2U
|
||||
#define timREAL_TIME_CLOCK 1U
|
||||
#define timNO_DST 3U
|
||||
#define timDAYLIGHT_SAVING_TIME 2U
|
||||
#define timNORMAL_TIME 1U
|
||||
#define TIME_MAX 2073600000
|
||||
#define TIME_MIN (-2073600000)
|
||||
#define DATE_AND_TIME_MAX 4102444799U
|
||||
#define timEXSETTIME_NO_OPTION 0U
|
||||
#define timEXSETTIME_NO_LOGENTRY 1U
|
||||
#else
|
||||
_IEC_CONST unsigned short timERR_AR = 33213U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_DTSTRUCTURE = 33212U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_LEN = 33211U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_PARAMETER = 33210U;
|
||||
_IEC_CONST unsigned char timTIME_SERVER = 2U;
|
||||
_IEC_CONST unsigned char timREAL_TIME_CLOCK = 1U;
|
||||
_IEC_CONST unsigned char timNO_DST = 3U;
|
||||
_IEC_CONST unsigned char timDAYLIGHT_SAVING_TIME = 2U;
|
||||
_IEC_CONST unsigned char timNORMAL_TIME = 1U;
|
||||
_IEC_CONST signed long TIME_MAX = 2073600000;
|
||||
_IEC_CONST signed long TIME_MIN = -2073600000;
|
||||
_IEC_CONST unsigned long DATE_AND_TIME_MAX = 4102444799U;
|
||||
_IEC_CONST unsigned char timEXSETTIME_NO_OPTION = 0U;
|
||||
_IEC_CONST unsigned char timEXSETTIME_NO_LOGENTRY = 1U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct TIMEStructure
|
||||
{ signed char day;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} TIMEStructure;
|
||||
|
||||
typedef struct DTStructure
|
||||
{ unsigned short year;
|
||||
unsigned char month;
|
||||
unsigned char day;
|
||||
unsigned char wday;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} DTStructure;
|
||||
|
||||
typedef struct DTExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTExSetTime_typ;
|
||||
|
||||
typedef struct DTSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTSetTime_typ;
|
||||
|
||||
typedef struct DTGetTime
|
||||
{
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
plcdt DT1;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTGetTime_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void DTExSetTime(struct DTExSetTime* inst);
|
||||
void DTSetTime(struct DTSetTime* inst);
|
||||
void DTGetTime(struct DTGetTime* inst);
|
||||
unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
|
||||
plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
|
||||
unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
|
||||
plcdt DTStructure_TO_DT(unsigned long pDTStructure);
|
||||
unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
|
||||
unsigned long DiffT(plctime TIME2, plctime TIME1);
|
||||
unsigned long DiffDT(plcdt DT2, plcdt DT1);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTIME_ */
|
||||
|
||||
|
||||
365
Logical/Libraries/astime/SG4/astime.h
Normal file
365
Logical/Libraries/astime/SG4/astime.h
Normal file
@@ -0,0 +1,365 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTIME_
|
||||
#define _ASTIME_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define timERR_AR 33213U
|
||||
#define timERR_INVALID_DTSTRUCTURE 33212U
|
||||
#define timERR_INVALID_LEN 33211U
|
||||
#define timERR_INVALID_PARAMETER 33210U
|
||||
#define timREDUND_INTERFACE 3U
|
||||
#define timTIME_SERVER 2U
|
||||
#define timREAL_TIME_CLOCK 1U
|
||||
#define timNO_DST 3U
|
||||
#define timDAYLIGHT_SAVING_TIME 2U
|
||||
#define timNORMAL_TIME 1U
|
||||
#define TIME_MAX 2073600000
|
||||
#define TIME_MIN (-2073600000)
|
||||
#define DATE_AND_TIME_MAX 4102444799U
|
||||
#define timEXSETTIME_NO_OPTION 0U
|
||||
#define timEXSETTIME_NO_LOGENTRY 1U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned short timERR_AR;
|
||||
_GLOBAL_CONST unsigned short timERR_INVALID_DTSTRUCTURE;
|
||||
_GLOBAL_CONST unsigned short timERR_INVALID_LEN;
|
||||
_GLOBAL_CONST unsigned short timERR_INVALID_PARAMETER;
|
||||
_GLOBAL_CONST unsigned char timREDUND_INTERFACE;
|
||||
_GLOBAL_CONST unsigned char timTIME_SERVER;
|
||||
_GLOBAL_CONST unsigned char timREAL_TIME_CLOCK;
|
||||
_GLOBAL_CONST unsigned char timNO_DST;
|
||||
_GLOBAL_CONST unsigned char timDAYLIGHT_SAVING_TIME;
|
||||
_GLOBAL_CONST unsigned char timNORMAL_TIME;
|
||||
_GLOBAL_CONST signed long TIME_MAX;
|
||||
_GLOBAL_CONST signed long TIME_MIN;
|
||||
_GLOBAL_CONST unsigned long DATE_AND_TIME_MAX;
|
||||
_GLOBAL_CONST unsigned char timEXSETTIME_NO_OPTION;
|
||||
_GLOBAL_CONST unsigned char timEXSETTIME_NO_LOGENTRY;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct TIMEStructure
|
||||
{ signed char day;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} TIMEStructure;
|
||||
|
||||
typedef struct DTStructure
|
||||
{ unsigned short year;
|
||||
unsigned char month;
|
||||
unsigned char day;
|
||||
unsigned char wday;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} DTStructure;
|
||||
|
||||
typedef struct DTExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTExSetTime_typ;
|
||||
|
||||
typedef struct DTSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTSetTime_typ;
|
||||
|
||||
typedef struct DTGetTime
|
||||
{
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
plcdt DT1;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTGetTime_typ;
|
||||
|
||||
typedef struct UtcDTGetTime
|
||||
{
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
plcdt DT1;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UtcDTGetTime_typ;
|
||||
|
||||
typedef struct UtcDTSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
/* 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;
|
||||
} UtcDTSetTime_typ;
|
||||
|
||||
typedef struct UtcDTExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UtcDTExSetTime_typ;
|
||||
|
||||
typedef struct DTStructureGetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTStructureGetTime_typ;
|
||||
|
||||
typedef struct DTStructureSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTStructureSetTime_typ;
|
||||
|
||||
typedef struct DTStructureExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTStructureExSetTime_typ;
|
||||
|
||||
typedef struct UtcDTStructureGetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UtcDTStructureGetTime_typ;
|
||||
|
||||
typedef struct UtcDTStructureSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* 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;
|
||||
} UtcDTStructureSetTime_typ;
|
||||
|
||||
typedef struct UtcDTStructureExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UtcDTStructureExSetTime_typ;
|
||||
|
||||
typedef struct UtcDT_TO_LocalDTStructure
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned long pDTStructure;
|
||||
/* 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;
|
||||
} UtcDT_TO_LocalDTStructure_typ;
|
||||
|
||||
typedef struct LocalDT_TO_UtcDTStructure
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned long pDTStructure;
|
||||
/* 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;
|
||||
} LocalDT_TO_UtcDTStructure_typ;
|
||||
|
||||
typedef struct UtcDTStructure_TO_LocalDT
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} UtcDTStructure_TO_LocalDT_typ;
|
||||
|
||||
typedef struct LocalDTStructure_TO_UtcDT
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} LocalDTStructure_TO_UtcDT_typ;
|
||||
|
||||
typedef struct TimeDeviceGetInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pServer;
|
||||
unsigned char len;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned char timeDevice;
|
||||
float avgDeviation;
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} TimeDeviceGetInfo_typ;
|
||||
|
||||
typedef struct DstGetInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pDTStructure;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned char dstState;
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DstGetInfo_typ;
|
||||
|
||||
typedef struct DstGetInfoDT
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned char dstState;
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned short i_state;
|
||||
unsigned short i_result;
|
||||
unsigned long i_tmp;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DstGetInfoDT_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void DTExSetTime(struct DTExSetTime* inst);
|
||||
_BUR_PUBLIC void DTSetTime(struct DTSetTime* inst);
|
||||
_BUR_PUBLIC void DTGetTime(struct DTGetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTGetTime(struct UtcDTGetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTSetTime(struct UtcDTSetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTExSetTime(struct UtcDTExSetTime* inst);
|
||||
_BUR_PUBLIC void DTStructureGetTime(struct DTStructureGetTime* inst);
|
||||
_BUR_PUBLIC void DTStructureSetTime(struct DTStructureSetTime* inst);
|
||||
_BUR_PUBLIC void DTStructureExSetTime(struct DTStructureExSetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTStructureGetTime(struct UtcDTStructureGetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTStructureSetTime(struct UtcDTStructureSetTime* inst);
|
||||
_BUR_PUBLIC void UtcDTStructureExSetTime(struct UtcDTStructureExSetTime* inst);
|
||||
_BUR_PUBLIC void UtcDT_TO_LocalDTStructure(struct UtcDT_TO_LocalDTStructure* inst);
|
||||
_BUR_PUBLIC void LocalDT_TO_UtcDTStructure(struct LocalDT_TO_UtcDTStructure* inst);
|
||||
_BUR_PUBLIC void UtcDTStructure_TO_LocalDT(struct UtcDTStructure_TO_LocalDT* inst);
|
||||
_BUR_PUBLIC void LocalDTStructure_TO_UtcDT(struct LocalDTStructure_TO_UtcDT* inst);
|
||||
_BUR_PUBLIC void TimeDeviceGetInfo(struct TimeDeviceGetInfo* inst);
|
||||
_BUR_PUBLIC void DstGetInfo(struct DstGetInfo* inst);
|
||||
_BUR_PUBLIC void DstGetInfoDT(struct DstGetInfoDT* inst);
|
||||
_BUR_PUBLIC plctime clock_ms(void);
|
||||
_BUR_PUBLIC unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
|
||||
_BUR_PUBLIC unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
|
||||
_BUR_PUBLIC unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
|
||||
_BUR_PUBLIC unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
|
||||
_BUR_PUBLIC plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
|
||||
_BUR_PUBLIC unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
|
||||
_BUR_PUBLIC plcdt DTStructure_TO_DT(unsigned long pDTStructure);
|
||||
_BUR_PUBLIC unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
|
||||
_BUR_PUBLIC unsigned long DiffT(plctime TIME2, plctime TIME1);
|
||||
_BUR_PUBLIC unsigned long DiffDT(plcdt DT2, plcdt DT1);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTIME_ */
|
||||
|
||||
130
Logical/Libraries/astime/SGC/astime.h
Normal file
130
Logical/Libraries/astime/SGC/astime.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASTIME_
|
||||
#define _ASTIME_
|
||||
#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 timERR_AR 33213U
|
||||
#define timERR_INVALID_DTSTRUCTURE 33212U
|
||||
#define timERR_INVALID_LEN 33211U
|
||||
#define timERR_INVALID_PARAMETER 33210U
|
||||
#define timTIME_SERVER 2U
|
||||
#define timREAL_TIME_CLOCK 1U
|
||||
#define timNO_DST 3U
|
||||
#define timDAYLIGHT_SAVING_TIME 2U
|
||||
#define timNORMAL_TIME 1U
|
||||
#define TIME_MAX 2073600000
|
||||
#define TIME_MIN (-2073600000)
|
||||
#define DATE_AND_TIME_MAX 4102444799U
|
||||
#define timEXSETTIME_NO_OPTION 0U
|
||||
#define timEXSETTIME_NO_LOGENTRY 1U
|
||||
#else
|
||||
_IEC_CONST unsigned short timERR_AR = 33213U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_DTSTRUCTURE = 33212U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_LEN = 33211U;
|
||||
_IEC_CONST unsigned short timERR_INVALID_PARAMETER = 33210U;
|
||||
_IEC_CONST unsigned char timTIME_SERVER = 2U;
|
||||
_IEC_CONST unsigned char timREAL_TIME_CLOCK = 1U;
|
||||
_IEC_CONST unsigned char timNO_DST = 3U;
|
||||
_IEC_CONST unsigned char timDAYLIGHT_SAVING_TIME = 2U;
|
||||
_IEC_CONST unsigned char timNORMAL_TIME = 1U;
|
||||
_IEC_CONST signed long TIME_MAX = 2073600000;
|
||||
_IEC_CONST signed long TIME_MIN = -2073600000;
|
||||
_IEC_CONST unsigned long DATE_AND_TIME_MAX = 4102444799U;
|
||||
_IEC_CONST unsigned char timEXSETTIME_NO_OPTION = 0U;
|
||||
_IEC_CONST unsigned char timEXSETTIME_NO_LOGENTRY = 1U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct TIMEStructure
|
||||
{ signed char day;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} TIMEStructure;
|
||||
|
||||
typedef struct DTStructure
|
||||
{ unsigned short year;
|
||||
unsigned char month;
|
||||
unsigned char day;
|
||||
unsigned char wday;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
unsigned short millisec;
|
||||
unsigned short microsec;
|
||||
} DTStructure;
|
||||
|
||||
typedef struct DTExSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
unsigned char Option;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTExSetTime_typ;
|
||||
|
||||
typedef struct DTSetTime
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plcdt DT1;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTSetTime_typ;
|
||||
|
||||
typedef struct DTGetTime
|
||||
{
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
plcdt DT1;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} DTGetTime_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void DTExSetTime(struct DTExSetTime* inst);
|
||||
void DTSetTime(struct DTSetTime* inst);
|
||||
void DTGetTime(struct DTGetTime* inst);
|
||||
unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
|
||||
unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
|
||||
plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
|
||||
unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
|
||||
plcdt DTStructure_TO_DT(unsigned long pDTStructure);
|
||||
unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
|
||||
unsigned long DiffT(plctime TIME2, plctime TIME1);
|
||||
unsigned long DiffDT(plcdt DT2, plcdt DT1);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASTIME_ */
|
||||
|
||||
|
||||
333
Logical/Libraries/astime/astime.fun
Normal file
333
Logical/Libraries/astime/astime.fun
Normal file
@@ -0,0 +1,333 @@
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK DTExSetTime (*sets the current time using the DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*date and time to be written*)
|
||||
Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK DTSetTime (*sets current time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*date and time to be written*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK DTGetTime (*reads the current time in the DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
DT1 :DATE_AND_TIME; (*date and time read*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_OK} FUNCTION clock_ms : TIME (*provides a continuous millisecond counter in the TIME data type*)
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK UtcDTGetTime (*reads the current UTC-time in the DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
DT1 :DATE_AND_TIME; (*UTC date and time read*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTSetTime (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*UTC date and time 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
|
||||
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 UtcDTExSetTime (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*UTC date and time to be written*)
|
||||
Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
|
||||
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 DTStructureGetTime (*reads the current time in the calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DTStructureSetTime (*sets current time in calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DTStructureExSetTime (*sets current time in calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructureGetTime (*reads the UTC time in the calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructureSetTime (*sets UTC time in calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
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 UtcDTStructureExSetTime (*sets UTC time in calendar structure*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
|
||||
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 UtcDT_TO_LocalDTStructure (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*UTC date and time*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
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 LocalDT_TO_UtcDTStructure (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*Local date and time*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
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 UtcDTStructure_TO_LocalDT (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
DT1 :DATE_AND_TIME; (*Local date and time*)
|
||||
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 LocalDTStructure_TO_UtcDT (*sets current UTC-time in DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
DT1 :DATE_AND_TIME; (*UTC date and time*)
|
||||
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 ascTIMEStructure : UDINT (*converts a "time" structure to a character string in the format "15:14:13\0"*)
|
||||
VAR_INPUT
|
||||
pTIMEStructure :UDINT; (*address of the time structure*)
|
||||
pStr :UDINT; (*address of the character field*)
|
||||
len :UDINT; (*length of the character field *)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascDTStructure : UDINT (*converts a "date" structure to a character string in the format "Sun Jan 3 15:14:13 1988\0"*)
|
||||
VAR_INPUT
|
||||
pDTStructure :UDINT; (*address of the calendar structure *)
|
||||
pStr :UDINT; (*address of the character field*)
|
||||
len :UDINT; (*length of the character field*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascTIME : UDINT (*converts the TIME data type to a character string in the format "15:14:13\0"*)
|
||||
VAR_INPUT
|
||||
TIME1 :TIME; (*time*)
|
||||
pStr :UDINT; (*address of the character field*)
|
||||
len :UDINT; (*length of the character field*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascDT : UDINT (*converts the DATE_AND_TIME data type to character string in the format "Sun Jan 3 15:14:13 1988\0"*)
|
||||
VAR_INPUT
|
||||
DT1 :DATE_AND_TIME; (*date and time*)
|
||||
pStr :UDINT; (*address of the character field*)
|
||||
len :UDINT; (*length of the character field*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION TIMEStructure_TO_TIME : TIME (*converts a "time" structure to the TIME data type*)
|
||||
VAR_INPUT
|
||||
pTIMEStructure :UDINT; (*address of the time structure*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_TIMEStructure : UDINT (*converts the TIME data type to a "time" structure*)
|
||||
VAR_INPUT
|
||||
TIME1 :TIME; (*time*)
|
||||
pTIMEStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION DTStructure_TO_DT : DATE_AND_TIME (*converts a "date" structure to the DATE_AND_TIME data type*)
|
||||
VAR_INPUT
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION DT_TO_DTStructure : UDINT (*converts the DATE_AND_TIME data type to a "date" structure*)
|
||||
VAR_INPUT
|
||||
DT1 :DATE_AND_TIME; (*date and time*)
|
||||
pDTStructure :UDINT; (*address of the calendar structure*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION DiffT : UDINT (*shows the difference between two times (TIME data type) expressed in milliseconds*)
|
||||
VAR_INPUT
|
||||
TIME2 :TIME; (*time 2*)
|
||||
TIME1 :TIME; (*time 1*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_OK} FUNCTION DiffDT : UDINT (*shows the difference between two times (DATE_AND_TIME data type) expressed in seconds*)
|
||||
VAR_INPUT
|
||||
DT2 :DATE_AND_TIME; (*date and time 2*)
|
||||
DT1 :DATE_AND_TIME; (*date and time 1*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TimeDeviceGetInfo (*read information about time device*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pServer :UDINT; (*Pointer to string*)
|
||||
len :USINT; (*length of pServer*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
timeDevice :USINT; (*sntpREAL_TIME_CLOCK or sntpTIME_SERVER*)
|
||||
avgDeviation :REAL; (*average deviation between software time and time device*)
|
||||
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 DstGetInfo (*read information about time device*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
pDTStructure :UDINT; (*Pointer to DTStructure*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
dstState :USINT; (*timDAYLIGHT_SAVING_TIME, timNORMAL_TIME or timNO_DST*)
|
||||
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 DstGetInfoDT (*read information about time device*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
DT1 :DATE_AND_TIME; (*date and time in UTC*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
dstState :USINT; (*timDAYLIGHT_SAVING_TIME, timNORMAL_TIME or timNO_DST*)
|
||||
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
|
||||
22
Logical/Libraries/astime/astime.typ
Normal file
22
Logical/Libraries/astime/astime.typ
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
TYPE
|
||||
TIMEStructure : STRUCT (*time structure*)
|
||||
day : SINT ; (*day (1-31)*)
|
||||
hour : USINT ; (*hours (0-23)*)
|
||||
minute : USINT ; (*minutes (0-59)*)
|
||||
second : USINT ; (*seconds (0-59)*)
|
||||
millisec : UINT ; (*milliseconds (0-999)*)
|
||||
microsec : UINT ; (*microseconds (0-999)*)
|
||||
END_STRUCT;
|
||||
DTStructure : STRUCT (*date structure*)
|
||||
year : UINT ; (*year*)
|
||||
month : USINT ; (*month (1-12)*)
|
||||
day : USINT ; (*day (1-31)*)
|
||||
wday : USINT ; (*day of the week (0-6), e.g. 0 = Sunday, 6 = Saturday*)
|
||||
hour : USINT ; (*hours (0-23)*)
|
||||
minute : USINT ; (*minutes (0-59)*)
|
||||
second : USINT ; (*seconds (0-59)*)
|
||||
millisec : UINT ; (*milliseconds (0-999)*)
|
||||
microsec : UINT ; (*microseconds (0-999)*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
18
Logical/Libraries/astime/astime.var
Normal file
18
Logical/Libraries/astime/astime.var
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
VAR CONSTANT
|
||||
timEXSETTIME_NO_LOGENTRY : USINT := 1;
|
||||
timEXSETTIME_NO_OPTION : USINT := 0;
|
||||
DATE_AND_TIME_MAX : UDINT := 4102444799;
|
||||
TIME_MIN : DINT := -2073600000;
|
||||
TIME_MAX : DINT := 2073600000;
|
||||
timNORMAL_TIME : USINT := 1;
|
||||
timDAYLIGHT_SAVING_TIME : USINT := 2;
|
||||
timNO_DST : USINT := 3;
|
||||
timREAL_TIME_CLOCK : USINT := 1;
|
||||
timTIME_SERVER : USINT := 2;
|
||||
timREDUND_INTERFACE : USINT := 3;
|
||||
timERR_INVALID_PARAMETER : UINT := 33210;
|
||||
timERR_INVALID_LEN : UINT := 33211;
|
||||
timERR_INVALID_DTSTRUCTURE : UINT := 33212;
|
||||
timERR_AR : UINT := 33213;
|
||||
END_VAR
|
||||
12
Logical/Libraries/astime/binary.lby
Normal file
12
Logical/Libraries/astime/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The AsTime Library supports DATE_AND_TIME and TIME data types." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>astime.fun</File>
|
||||
<File>astime.typ</File>
|
||||
<File>astime.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
227
Logical/Libraries/dvframe/SG3/dvframe.h
Normal file
227
Logical/Libraries/dvframe/SG3/dvframe.h
Normal file
@@ -0,0 +1,227 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DVFRAME_
|
||||
#define _DVFRAME_
|
||||
#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 ARG_BAUD 0U
|
||||
#define ARG_MISC 16U
|
||||
#define frmERR_OK 0U
|
||||
#define ARG_PVPOLLADR 15U
|
||||
#define frmERR_MAXOPEN 8254U
|
||||
#define frmERR_NOINPUT 60U
|
||||
#define ARG_TXPVPOLLADR 17U
|
||||
#define frmERR_NOBUFFER 8071U
|
||||
#define frmERR_PA_DB_SB 8256U
|
||||
#define MISC_RECEIVE_ALL 2U
|
||||
#define frmERR_NOTOPENED 8251U
|
||||
#define frmERR_INPUTERROR 8079U
|
||||
#define frmERR_NORESOURCES 8258U
|
||||
#define ARG_EVSEND_TASKEVENT 18U
|
||||
#define ARG_EVSEND_TASKIDENT 14U
|
||||
#define frmERR_INVALIDBUFFER 8072U
|
||||
#define frmERR_IOCTL_NOTVALID 8073U
|
||||
#define frmERR_MODEDESCRIPTION 8253U
|
||||
#define frmERR_TRANSMITOVERRUN 8078U
|
||||
#define frmERR_FUB_ENABLE_FALSE 65534U
|
||||
#define frmERR_DEVICEDESCRIPTION 8252U
|
||||
#define frmERR_IOCTL_NOTSUPPORTED 8257U
|
||||
#else
|
||||
_IEC_CONST unsigned long ARG_BAUD = 0U;
|
||||
_IEC_CONST unsigned long ARG_MISC = 16U;
|
||||
_IEC_CONST unsigned short frmERR_OK = 0U;
|
||||
_IEC_CONST unsigned long ARG_PVPOLLADR = 15U;
|
||||
_IEC_CONST unsigned short frmERR_MAXOPEN = 8254U;
|
||||
_IEC_CONST unsigned short frmERR_NOINPUT = 60U;
|
||||
_IEC_CONST unsigned long ARG_TXPVPOLLADR = 17U;
|
||||
_IEC_CONST unsigned short frmERR_NOBUFFER = 8071U;
|
||||
_IEC_CONST unsigned short frmERR_PA_DB_SB = 8256U;
|
||||
_IEC_CONST unsigned long MISC_RECEIVE_ALL = 2U;
|
||||
_IEC_CONST unsigned short frmERR_NOTOPENED = 8251U;
|
||||
_IEC_CONST unsigned short frmERR_INPUTERROR = 8079U;
|
||||
_IEC_CONST unsigned short frmERR_NORESOURCES = 8258U;
|
||||
_IEC_CONST unsigned long ARG_EVSEND_TASKEVENT = 18U;
|
||||
_IEC_CONST unsigned long ARG_EVSEND_TASKIDENT = 14U;
|
||||
_IEC_CONST unsigned short frmERR_INVALIDBUFFER = 8072U;
|
||||
_IEC_CONST unsigned short frmERR_IOCTL_NOTVALID = 8073U;
|
||||
_IEC_CONST unsigned short frmERR_MODEDESCRIPTION = 8253U;
|
||||
_IEC_CONST unsigned short frmERR_TRANSMITOVERRUN = 8078U;
|
||||
_IEC_CONST unsigned short frmERR_FUB_ENABLE_FALSE = 65534U;
|
||||
_IEC_CONST unsigned short frmERR_DEVICEDESCRIPTION = 8252U;
|
||||
_IEC_CONST unsigned short frmERR_IOCTL_NOTSUPPORTED = 8257U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct XOPENCONFIG
|
||||
{ unsigned short idle;
|
||||
unsigned short delimc;
|
||||
unsigned char delim[2];
|
||||
unsigned short tx_cnt;
|
||||
unsigned short rx_cnt;
|
||||
unsigned short tx_len;
|
||||
unsigned short rx_len;
|
||||
unsigned short argc;
|
||||
unsigned long argv;
|
||||
} XOPENCONFIG;
|
||||
|
||||
typedef struct FRM_mode
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long mode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_mode_typ;
|
||||
|
||||
typedef struct FRM_ctrl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned short ioctrl;
|
||||
unsigned long inarg;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outarg;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[44];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_ctrl_typ;
|
||||
|
||||
typedef struct FRM_robuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_robuf_typ;
|
||||
|
||||
typedef struct FRM_gbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_gbuf_typ;
|
||||
|
||||
typedef struct FRM_rbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_rbuf_typ;
|
||||
|
||||
typedef struct FRM_close
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_close_typ;
|
||||
|
||||
typedef struct FRM_write
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_write_typ;
|
||||
|
||||
typedef struct FRM_read
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_read_typ;
|
||||
|
||||
typedef struct FRM_xopen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long device;
|
||||
unsigned long mode;
|
||||
unsigned long config;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_xopen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void FRM_mode(struct FRM_mode* inst);
|
||||
void FRM_ctrl(struct FRM_ctrl* inst);
|
||||
void FRM_robuf(struct FRM_robuf* inst);
|
||||
void FRM_gbuf(struct FRM_gbuf* inst);
|
||||
void FRM_rbuf(struct FRM_rbuf* inst);
|
||||
void FRM_close(struct FRM_close* inst);
|
||||
void FRM_write(struct FRM_write* inst);
|
||||
void FRM_read(struct FRM_read* inst);
|
||||
void FRM_xopen(struct FRM_xopen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DVFRAME_ */
|
||||
|
||||
248
Logical/Libraries/dvframe/SG4/dvframe.h
Normal file
248
Logical/Libraries/dvframe/SG4/dvframe.h
Normal file
@@ -0,0 +1,248 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DVFRAME_
|
||||
#define _DVFRAME_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define ARG_BAUD 0U
|
||||
#define ARG_MISC 16U
|
||||
#define frmERR_OK 0U
|
||||
#define ARG_PVPOLLADR 15U
|
||||
#define frmERR_MAXOPEN 8254U
|
||||
#define frmERR_NOINPUT 60U
|
||||
#define ARG_TXPVPOLLADR 17U
|
||||
#define frmERR_NOBUFFER 8071U
|
||||
#define frmERR_PA_DB_SB 8256U
|
||||
#define MISC_RECEIVE_ALL 2U
|
||||
#define frmERR_NOTOPENED 8251U
|
||||
#define frmERR_INPUTERROR 8079U
|
||||
#define frmERR_NORESOURCES 8258U
|
||||
#define ARG_EVSEND_TASKEVENT 18U
|
||||
#define ARG_EVSEND_TASKIDENT 14U
|
||||
#define frmERR_INIT_IN_PROGRESS 8068U
|
||||
#define frmERR_IF_UNREACHABLE 8067U
|
||||
#define frmERR_INVALIDBUFFER 8072U
|
||||
#define frmERR_IOCTL_NOTVALID 8073U
|
||||
#define frmERR_MODEDESCRIPTION 8253U
|
||||
#define frmERR_TRANSMITOVERRUN 8078U
|
||||
#define frmERR_FUB_ENABLE_FALSE 65534U
|
||||
#define frmERR_DEVICEDESCRIPTION 8252U
|
||||
#define frmERR_IOCTL_NOTSUPPORTED 8257U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned long ARG_BAUD;
|
||||
_GLOBAL_CONST unsigned long ARG_MISC;
|
||||
_GLOBAL_CONST unsigned short frmERR_OK;
|
||||
_GLOBAL_CONST unsigned long ARG_PVPOLLADR;
|
||||
_GLOBAL_CONST unsigned short frmERR_MAXOPEN;
|
||||
_GLOBAL_CONST unsigned short frmERR_NOINPUT;
|
||||
_GLOBAL_CONST unsigned long ARG_TXPVPOLLADR;
|
||||
_GLOBAL_CONST unsigned short frmERR_NOBUFFER;
|
||||
_GLOBAL_CONST unsigned short frmERR_PA_DB_SB;
|
||||
_GLOBAL_CONST unsigned long MISC_RECEIVE_ALL;
|
||||
_GLOBAL_CONST unsigned short frmERR_NOTOPENED;
|
||||
_GLOBAL_CONST unsigned short frmERR_INPUTERROR;
|
||||
_GLOBAL_CONST unsigned short frmERR_NORESOURCES;
|
||||
_GLOBAL_CONST unsigned long ARG_EVSEND_TASKEVENT;
|
||||
_GLOBAL_CONST unsigned long ARG_EVSEND_TASKIDENT;
|
||||
_GLOBAL_CONST unsigned short frmERR_INIT_IN_PROGRESS;
|
||||
_GLOBAL_CONST unsigned short frmERR_IF_UNREACHABLE;
|
||||
_GLOBAL_CONST unsigned short frmERR_INVALIDBUFFER;
|
||||
_GLOBAL_CONST unsigned short frmERR_IOCTL_NOTVALID;
|
||||
_GLOBAL_CONST unsigned short frmERR_MODEDESCRIPTION;
|
||||
_GLOBAL_CONST unsigned short frmERR_TRANSMITOVERRUN;
|
||||
_GLOBAL_CONST unsigned short frmERR_FUB_ENABLE_FALSE;
|
||||
_GLOBAL_CONST unsigned short frmERR_DEVICEDESCRIPTION;
|
||||
_GLOBAL_CONST unsigned short frmERR_IOCTL_NOTSUPPORTED;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct XOPENCONFIG
|
||||
{ unsigned short idle;
|
||||
unsigned short delimc;
|
||||
unsigned char delim[2];
|
||||
unsigned short tx_cnt;
|
||||
unsigned short rx_cnt;
|
||||
unsigned short tx_len;
|
||||
unsigned short rx_len;
|
||||
unsigned short argc;
|
||||
unsigned long argv;
|
||||
} XOPENCONFIG;
|
||||
|
||||
typedef struct FRM_mode
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long mode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_mode_typ;
|
||||
|
||||
typedef struct FRM_ctrl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned short ioctrl;
|
||||
unsigned long inarg;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outarg;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[44];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_ctrl_typ;
|
||||
|
||||
typedef struct FRM_robuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_robuf_typ;
|
||||
|
||||
typedef struct FRM_gbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_gbuf_typ;
|
||||
|
||||
typedef struct FRM_rbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_rbuf_typ;
|
||||
|
||||
typedef struct FRM_close
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_close_typ;
|
||||
|
||||
typedef struct FRM_write
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_write_typ;
|
||||
|
||||
typedef struct FRM_writeAcknowledged
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_writeAcknowledged_typ;
|
||||
|
||||
typedef struct FRM_read
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_read_typ;
|
||||
|
||||
typedef struct FRM_xopen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long device;
|
||||
unsigned long mode;
|
||||
unsigned long config;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_xopen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void FRM_mode(struct FRM_mode* inst);
|
||||
_BUR_PUBLIC void FRM_ctrl(struct FRM_ctrl* inst);
|
||||
_BUR_PUBLIC void FRM_robuf(struct FRM_robuf* inst);
|
||||
_BUR_PUBLIC void FRM_gbuf(struct FRM_gbuf* inst);
|
||||
_BUR_PUBLIC void FRM_rbuf(struct FRM_rbuf* inst);
|
||||
_BUR_PUBLIC void FRM_close(struct FRM_close* inst);
|
||||
_BUR_PUBLIC void FRM_write(struct FRM_write* inst);
|
||||
_BUR_PUBLIC void FRM_writeAcknowledged(struct FRM_writeAcknowledged* inst);
|
||||
_BUR_PUBLIC void FRM_read(struct FRM_read* inst);
|
||||
_BUR_PUBLIC void FRM_xopen(struct FRM_xopen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DVFRAME_ */
|
||||
|
||||
227
Logical/Libraries/dvframe/SGC/dvframe.h
Normal file
227
Logical/Libraries/dvframe/SGC/dvframe.h
Normal file
@@ -0,0 +1,227 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _DVFRAME_
|
||||
#define _DVFRAME_
|
||||
#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 ARG_BAUD 0U
|
||||
#define ARG_MISC 16U
|
||||
#define frmERR_OK 0U
|
||||
#define ARG_PVPOLLADR 15U
|
||||
#define frmERR_MAXOPEN 8254U
|
||||
#define frmERR_NOINPUT 60U
|
||||
#define ARG_TXPVPOLLADR 17U
|
||||
#define frmERR_NOBUFFER 8071U
|
||||
#define frmERR_PA_DB_SB 8256U
|
||||
#define MISC_RECEIVE_ALL 2U
|
||||
#define frmERR_NOTOPENED 8251U
|
||||
#define frmERR_INPUTERROR 8079U
|
||||
#define frmERR_NORESOURCES 8258U
|
||||
#define ARG_EVSEND_TASKEVENT 18U
|
||||
#define ARG_EVSEND_TASKIDENT 14U
|
||||
#define frmERR_INVALIDBUFFER 8072U
|
||||
#define frmERR_IOCTL_NOTVALID 8073U
|
||||
#define frmERR_MODEDESCRIPTION 8253U
|
||||
#define frmERR_TRANSMITOVERRUN 8078U
|
||||
#define frmERR_FUB_ENABLE_FALSE 65534U
|
||||
#define frmERR_DEVICEDESCRIPTION 8252U
|
||||
#define frmERR_IOCTL_NOTSUPPORTED 8257U
|
||||
#else
|
||||
_IEC_CONST unsigned long ARG_BAUD = 0U;
|
||||
_IEC_CONST unsigned long ARG_MISC = 16U;
|
||||
_IEC_CONST unsigned short frmERR_OK = 0U;
|
||||
_IEC_CONST unsigned long ARG_PVPOLLADR = 15U;
|
||||
_IEC_CONST unsigned short frmERR_MAXOPEN = 8254U;
|
||||
_IEC_CONST unsigned short frmERR_NOINPUT = 60U;
|
||||
_IEC_CONST unsigned long ARG_TXPVPOLLADR = 17U;
|
||||
_IEC_CONST unsigned short frmERR_NOBUFFER = 8071U;
|
||||
_IEC_CONST unsigned short frmERR_PA_DB_SB = 8256U;
|
||||
_IEC_CONST unsigned long MISC_RECEIVE_ALL = 2U;
|
||||
_IEC_CONST unsigned short frmERR_NOTOPENED = 8251U;
|
||||
_IEC_CONST unsigned short frmERR_INPUTERROR = 8079U;
|
||||
_IEC_CONST unsigned short frmERR_NORESOURCES = 8258U;
|
||||
_IEC_CONST unsigned long ARG_EVSEND_TASKEVENT = 18U;
|
||||
_IEC_CONST unsigned long ARG_EVSEND_TASKIDENT = 14U;
|
||||
_IEC_CONST unsigned short frmERR_INVALIDBUFFER = 8072U;
|
||||
_IEC_CONST unsigned short frmERR_IOCTL_NOTVALID = 8073U;
|
||||
_IEC_CONST unsigned short frmERR_MODEDESCRIPTION = 8253U;
|
||||
_IEC_CONST unsigned short frmERR_TRANSMITOVERRUN = 8078U;
|
||||
_IEC_CONST unsigned short frmERR_FUB_ENABLE_FALSE = 65534U;
|
||||
_IEC_CONST unsigned short frmERR_DEVICEDESCRIPTION = 8252U;
|
||||
_IEC_CONST unsigned short frmERR_IOCTL_NOTSUPPORTED = 8257U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct XOPENCONFIG
|
||||
{ unsigned short idle;
|
||||
unsigned short delimc;
|
||||
unsigned char delim[2];
|
||||
unsigned short tx_cnt;
|
||||
unsigned short rx_cnt;
|
||||
unsigned short tx_len;
|
||||
unsigned short rx_len;
|
||||
unsigned short argc;
|
||||
unsigned long argv;
|
||||
} XOPENCONFIG;
|
||||
|
||||
typedef struct FRM_mode
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long mode;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_mode_typ;
|
||||
|
||||
typedef struct FRM_ctrl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned short ioctrl;
|
||||
unsigned long inarg;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long outarg;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[44];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_ctrl_typ;
|
||||
|
||||
typedef struct FRM_robuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_robuf_typ;
|
||||
|
||||
typedef struct FRM_gbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_gbuf_typ;
|
||||
|
||||
typedef struct FRM_rbuf
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_rbuf_typ;
|
||||
|
||||
typedef struct FRM_close
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_close_typ;
|
||||
|
||||
typedef struct FRM_write
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_write_typ;
|
||||
|
||||
typedef struct FRM_read
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long buffer;
|
||||
unsigned short buflng;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_read_typ;
|
||||
|
||||
typedef struct FRM_xopen
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long device;
|
||||
unsigned long mode;
|
||||
unsigned long config;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
plcstring internal[28];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} FRM_xopen_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void FRM_mode(struct FRM_mode* inst);
|
||||
void FRM_ctrl(struct FRM_ctrl* inst);
|
||||
void FRM_robuf(struct FRM_robuf* inst);
|
||||
void FRM_gbuf(struct FRM_gbuf* inst);
|
||||
void FRM_rbuf(struct FRM_rbuf* inst);
|
||||
void FRM_close(struct FRM_close* inst);
|
||||
void FRM_write(struct FRM_write* inst);
|
||||
void FRM_read(struct FRM_read* inst);
|
||||
void FRM_xopen(struct FRM_xopen* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _DVFRAME_ */
|
||||
|
||||
12
Logical/Libraries/dvframe/binary.lby
Normal file
12
Logical/Libraries/dvframe/binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="The DVFrame library and the frame driver can be used to exchange data with external devices." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>dvframe.fun</File>
|
||||
<File>dvframe.typ</File>
|
||||
<File>dvframe.var</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
149
Logical/Libraries/dvframe/dvframe.fun
Normal file
149
Logical/Libraries/dvframe/dvframe.fun
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_mode (*modifies the values for the baud rate and asynchronous parameters*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
mode :UDINT; (*address of the string which configures the interface to be used*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_ctrl (*operates the DSR/DTR signals for modem capable interfaces*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
ioctrl :UINT; (*control selection*)
|
||||
inarg :UDINT; (*input argument*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
outarg :UDINT; (*output argument*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[43]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_robuf (*releases the send buffer manually*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
buffer :UDINT; (*send buffer address*)
|
||||
buflng :UINT; (*send buffer length*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_gbuf (*requests an available send buffer*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
buffer :UDINT; (*send buffer address*)
|
||||
buflng :UINT; (*send buffer length*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_rbuf (*releases the receive buffer*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
buffer :UDINT; (*receive buffer address*)
|
||||
buflng :UINT; (*receive buffer length*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_close (*closes a previously opened serial interface*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_write (*enables the frame driver to send data to the send buffer*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
buffer :UDINT; (*send buffer address*)
|
||||
buflng :UINT; (*send buffer length*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_writeAcknowledged (*enables the frame driver to send data to the send buffer*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
buffer :UDINT; (*send buffer address*)
|
||||
buflng :UINT; (*send buffer length*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_read (*starts the receive process*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
ident :UDINT; (*driver ID for the interface (see FRM_xopen())*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
buffer :UDINT; (*receive buffer address*)
|
||||
buflng :UINT; (*receive buffer length*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK FRM_xopen (*opens a serial interface for frame transfer*)
|
||||
VAR_INPUT
|
||||
enable :BOOL; (*enables execution*)
|
||||
device :UDINT; (*pointer to a string which clearly describes the interface used*)
|
||||
mode :UDINT; (*pointer to the string which configures the interface to be used*)
|
||||
config :UDINT; (*address for a configuration structure can be entered at this point (optional entry)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident :UDINT; (*driver ID for the interface (required for other functions in the DVFrame library)*)
|
||||
END_VAR
|
||||
VAR
|
||||
internal :STRING[27]; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
14
Logical/Libraries/dvframe/dvframe.typ
Normal file
14
Logical/Libraries/dvframe/dvframe.typ
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
TYPE
|
||||
XOPENCONFIG : STRUCT
|
||||
idle : UINT ; (*maximum idle time between characters*)
|
||||
delimc : UINT ; (*activate the frame delimiters, standard value : 0*)
|
||||
delim : ARRAY[0..1] OF USINT ; (*frame delimiters, default value: 0,0*)
|
||||
tx_cnt : UINT ; (*number of send buffers (maximum 8), default value: 2*)
|
||||
rx_cnt : UINT ; (*number of receive buffers (maximum 8), default value: 2*)
|
||||
tx_len : UINT ; (*send buffer length, default value: 256 bytes*)
|
||||
rx_len : UINT ; (*receive buffer length, default value: 256 bytes*)
|
||||
argc : UINT ; (*number of additional arguments in argv, default value: 0*)
|
||||
argv : UDINT ; (*address for a UDINT field with additional arguments, default value: 0*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
27
Logical/Libraries/dvframe/dvframe.var
Normal file
27
Logical/Libraries/dvframe/dvframe.var
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
VAR CONSTANT
|
||||
frmERR_IOCTL_NOTSUPPORTED : UINT := 8257; (*command not supported by driver (hardware)*)
|
||||
frmERR_DEVICEDESCRIPTION : UINT := 8252; (*device not found*)
|
||||
frmERR_FUB_ENABLE_FALSE : UINT := 65534;
|
||||
frmERR_TRANSMITOVERRUN : UINT := 8078; (*send buffer waiting queue full*)
|
||||
frmERR_MODEDESCRIPTION : UINT := 8253; (*syntax error in mode parameter string, or mode parameter not supported by the specified device*)
|
||||
frmERR_IOCTL_NOTVALID : UINT := 8073; (*invalid I/O control code*)
|
||||
frmERR_INVALIDBUFFER : UINT := 8072; (*invalid buffer rejected*)
|
||||
frmERR_IF_UNREACHABLE : UINT := 8067; (*device is not available*)
|
||||
frmERR_INIT_IN_PROGRESS : UINT := 8068; (*device is busy with xopen/mode*)
|
||||
ARG_EVSEND_TASKIDENT : UDINT := 14;
|
||||
ARG_EVSEND_TASKEVENT : UDINT := 18;
|
||||
frmERR_NORESOURCES : UINT := 8258; (*required resource not available (memory, OS object, etc.)*)
|
||||
frmERR_INPUTERROR : UINT := 8079; (*frame buffer with defective character*)
|
||||
frmERR_NOTOPENED : UINT := 8251; (*device not open*)
|
||||
MISC_RECEIVE_ALL : UDINT := 2;
|
||||
frmERR_PA_DB_SB : UINT := 8256; (*/PA, /DB, /SB must always be specified together*)
|
||||
frmERR_NOBUFFER : UINT := 8071; (*no buffer available in the send buffer manager*)
|
||||
ARG_TXPVPOLLADR : UDINT := 17;
|
||||
frmERR_NOINPUT : UINT := 60; (*no message received*)
|
||||
frmERR_MAXOPEN : UINT := 8254; (*too many devices opened at once*)
|
||||
ARG_PVPOLLADR : UDINT := 15;
|
||||
frmERR_OK : UINT := 0;
|
||||
ARG_MISC : UDINT := 16;
|
||||
ARG_BAUD : UDINT := 0;
|
||||
END_VAR
|
||||
11
Logical/Libraries/operator/SG3/operator.h
Normal file
11
Logical/Libraries/operator/SG3/operator.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/****************************************************************************/
|
||||
/* */
|
||||
/* operator.h */
|
||||
/* */
|
||||
/* Automation Studio */
|
||||
/* Copyright Bernecker&Rainer 1998-1999 */
|
||||
/* */
|
||||
/****************************************************************************/
|
||||
|
||||
/* This library does not contain C code */
|
||||
|
||||
2
Logical/Libraries/operator/SG4/operator.h
Normal file
2
Logical/Libraries/operator/SG4/operator.h
Normal file
@@ -0,0 +1,2 @@
|
||||
/* This library does not contain C code */
|
||||
|
||||
11
Logical/Libraries/operator/SGC/operator.h
Normal file
11
Logical/Libraries/operator/SGC/operator.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/****************************************************************************/
|
||||
/* */
|
||||
/* operator.h */
|
||||
/* */
|
||||
/* Automation Studio */
|
||||
/* Copyright Bernecker&Rainer 1998-1999 */
|
||||
/* */
|
||||
/****************************************************************************/
|
||||
|
||||
/* This library does not contain C code */
|
||||
|
||||
9
Logical/Libraries/operator/binary.lby
Normal file
9
Logical/Libraries/operator/binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains function interfaces for IEC 61131-3 operator functions. For the most part, these are mathematical and logical functions." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>operator.fun</File>
|
||||
<File>operator.typ</File>
|
||||
<File>operator.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
224
Logical/Libraries/operator/operator.fun
Normal file
224
Logical/Libraries/operator/operator.fun
Normal file
@@ -0,0 +1,224 @@
|
||||
|
||||
{REDUND_OK} FUNCTION SIZEOF : UDINT (*determines the size of a variable in bytes*)
|
||||
VAR_INPUT
|
||||
in :ANY; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ADR : UDINT (*determines the address of a data point*)
|
||||
VAR_INPUT
|
||||
in :ANY; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ADRINST : UDINT (*determines the address of a fub instance*)
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SHR : ANY (*shifts bitwise to the right*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input value*)
|
||||
N :SINT; (*number of bits to be shifted*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ROR : ANY (*rotates bitwise to the right*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input value*)
|
||||
N :SINT; (*number of bits to be rotated*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ROL : ANY (*rotates bitwise to the left*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input value*)
|
||||
N :SINT; (*number of bits to be rotated*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SHL : ANY (*shifts bitwise to the left*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input value*)
|
||||
N :SINT; (*number of bits to be shifted*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION AND : ANY (*makes a bitwise AND relation for 2 or more variables*)
|
||||
VAR_INPUT
|
||||
INx :ANY; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION XOR : ANY (*makes a bitwise XOR relation for 2 or more variables*)
|
||||
VAR_INPUT
|
||||
INx :ANY; (*input values*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION OR : ANY (*makes a bitwise OR relation for 2 or more variables*)
|
||||
VAR_INPUT
|
||||
INx :ANY; (*input values*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION NOT : ANY (*makes a bitwise inversion of variables*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ADD : ANY (*adds 2 or more variables*)
|
||||
VAR_INPUT
|
||||
INx :ANY; (*input values*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MUL : ANY_NUM (*multiplies 2 or more variables*)
|
||||
VAR_INPUT
|
||||
INx :ANY_NUM; (*input values*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SUB : ANY (*subtracts one or more variables from another variable*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*value 1*)
|
||||
IN2 :ANY; (*value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION DIV : ANY_NUM (*divides a variable by one or more variables*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY_NUM; (*dividend*)
|
||||
IN2 :ANY_NUM; (*divisor*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MOD : ANY_INT (*makes a remainder when dividing a variable by another variable*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY_INT; (*dividend*)
|
||||
IN2 :ANY_INT; (*divisor*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MOVE : ANY (*copies the contents of the input variables to the corresponding output variables*)
|
||||
VAR_INPUT
|
||||
IN :ANY; (*input variable*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MAX : ANY (*determines the maximum value of two or more values*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*input value 1*)
|
||||
IN2 :ANY; (*input value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MIN : ANY (*determines the lowest value of two or more values*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*input value 1*)
|
||||
IN2 :ANY; (*input value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION LIMIT : ANY (*limits a value to within maximum and minimum boundaries*)
|
||||
VAR_INPUT
|
||||
MN :ANY; (*minimum value*)
|
||||
IN :ANY; (*input value*)
|
||||
MX :ANY; (*maximum value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SEL : ANY (*selects one value from two values*)
|
||||
VAR_INPUT
|
||||
G :BOOL; (*selection variable*)
|
||||
IN0 :ANY; (*input value for FALSE*)
|
||||
IN1 :ANY; (*input value for TRUE*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION MUX : ANY (*selects a value from several values*)
|
||||
VAR_INPUT
|
||||
K :SINT; (*selection variable*)
|
||||
INx :ANY; (*input values*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION GE : BOOL (*checks if the input values are in decreasing order*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION EQ : BOOL (*compares two or more values whether they are equal*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION GT : BOOL (*checks if the input values are in decreasing order*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION LE : BOOL (*checks if the input values are in increasing order*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION LT : BOOL (*checks if the input values are in increasing order*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION NE : BOOL (*compares two values whether they are not equal*)
|
||||
VAR_INPUT
|
||||
IN1 :ANY; (*comparison value 1*)
|
||||
IN2 :ANY; (*comparison value 2*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ABS : ANY_NUM (*returns the absolute value of a number*)
|
||||
VAR_INPUT
|
||||
IN :ANY_NUM; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SQRT : ANY_REAL (*returns the square root of a number*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION LN : ANY_REAL (*returns the result of a natural logarithm*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION LOG : ANY_REAL (*returns the result of a base 10 logarithm*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION EXP : ANY_REAL (*returns the result of a natural exponential function*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION SIN : ANY_REAL (*returns the sine of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value in radian*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION COS : ANY_REAL (*returns the cosine of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value in radian*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION TAN : ANY_REAL (*returns the tangent of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value in radian*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ASIN : ANY_REAL (*returns the arc sine (inverse function of sine) of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ACOS : ANY_REAL (*returns the arc cosine (inverse function of cosine) of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION ATAN : ANY_REAL (*returns the arc tangent (inverse function of tangent) of a number (calculated in radian)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION EXPT : REAL (*raises one variable to the power of another*)
|
||||
VAR_INPUT
|
||||
IN1 :REAL; (*base*)
|
||||
IN2 :ANY_NUM; (*exponent*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION TRUNC : INT (*converts from type REAL to type INT (number is always rounded down)*)
|
||||
VAR_INPUT
|
||||
IN :ANY_REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
4
Logical/Libraries/operator/operator.typ
Normal file
4
Logical/Libraries/operator/operator.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
4
Logical/Libraries/operator/operator.var
Normal file
4
Logical/Libraries/operator/operator.var
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
80
Logical/Libraries/runtime/SG3/runtime.h
Normal file
80
Logical/Libraries/runtime/SG3/runtime.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _RUNTIME_
|
||||
#define _RUNTIME_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define ERR_OK 0
|
||||
#define ERR_NOTIMPLEMENTED 9999
|
||||
#define ERR_FUB_ENABLE_FALSE 0xFFFE
|
||||
#define ERR_FUB_BUSY 0xFFFF
|
||||
|
||||
/* IEC 61131-3 Datentypen */
|
||||
#define IEC_DATATYPE_BOOL 1
|
||||
#define IEC_DATATYPE_SINT 2
|
||||
#define IEC_DATATYPE_INT 3
|
||||
#define IEC_DATATYPE_DINT 4
|
||||
#define IEC_DATATYPE_USINT 5
|
||||
#define IEC_DATATYPE_UINT 6
|
||||
#define IEC_DATATYPE_UDINT 7
|
||||
#define IEC_DATATYPE_REAL 8
|
||||
#define IEC_DATATYPE_STRING 9
|
||||
#define IEC_DATATYPE_ULINT 10
|
||||
#define IEC_DATATYPE_DATE_AND_TIME 11
|
||||
#define IEC_DATATYPE_TIME 12
|
||||
#define IEC_DATATYPE_DATE 13
|
||||
#define IEC_DATATYPE_LREAL 14
|
||||
#define IEC_DATATYPE_TIME_OF_DAY 16
|
||||
#define IEC_DATATYPE_BYTE 17
|
||||
#define IEC_DATATYPE_WORD 18
|
||||
#define IEC_DATATYPE_DWORD 19
|
||||
#define IEC_DATATYPE_LWORD 20
|
||||
#define IEC_DATATYPE_WSTRING 21
|
||||
#define IEC_DATATYPE_LINT 23
|
||||
|
||||
#else
|
||||
_IEC_CONST unsigned short ERR_OK = 0U;
|
||||
_IEC_CONST unsigned short ERR_NOTIMPLEMENTED = 9999U;
|
||||
_IEC_CONST unsigned short ERR_FUB_ENABLE_FALSE = 0xFFFEU;
|
||||
_IEC_CONST unsigned short ERR_FUB_BUSY = 0xFFFFU;
|
||||
|
||||
/* IEC 61131-3 Datentypen */
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_BOOL = 1;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_SINT = 2;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_INT = 3;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DINT = 4;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_USINT = 5;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_UINT = 6;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_UDINT = 7;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_REAL = 8;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_STRING = 9;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_ULINT = 10;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME = 11;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_TIME = 12;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DATE = 13;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LREAL = 14;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY = 16;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_BYTE = 17;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_WORD = 18;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DWORD = 19;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LWORD = 20;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_WSTRING = 21;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LINT = 23;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _RUNTIME_ */
|
||||
|
||||
489
Logical/Libraries/runtime/SG4/runtime.h
Normal file
489
Logical/Libraries/runtime/SG4/runtime.h
Normal file
@@ -0,0 +1,489 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _RUNTIME_
|
||||
#define _RUNTIME_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define IEC_DATATYPE_LINT 23U
|
||||
#define IEC_DATATYPE_WSTRING 21U
|
||||
#define IEC_DATATYPE_LWORD 20U
|
||||
#define IEC_DATATYPE_DWORD 19U
|
||||
#define IEC_DATATYPE_WORD 18U
|
||||
#define IEC_DATATYPE_BYTE 17U
|
||||
#define IEC_DATATYPE_TIME_OF_DAY 16U
|
||||
#define IEC_DATATYPE_LREAL 14U
|
||||
#define IEC_DATATYPE_DATE 13U
|
||||
#define IEC_DATATYPE_TIME 12U
|
||||
#define IEC_DATATYPE_DATE_AND_TIME 11U
|
||||
#define IEC_DATATYPE_ULINT 10U
|
||||
#define IEC_DATATYPE_STRING 9U
|
||||
#define IEC_DATATYPE_REAL 8U
|
||||
#define IEC_DATATYPE_UDINT 7U
|
||||
#define IEC_DATATYPE_UINT 6U
|
||||
#define IEC_DATATYPE_USINT 5U
|
||||
#define IEC_DATATYPE_DINT 4U
|
||||
#define IEC_DATATYPE_INT 3U
|
||||
#define IEC_DATATYPE_SINT 2U
|
||||
#define IEC_DATATYPE_BOOL 1U
|
||||
#define ERR_FB_NOT_IMPLEMENTED (-1070585592)
|
||||
#define ERR_FUB_REDUNDANT 35688U
|
||||
#define ERR_FUB_BUSY 65535U
|
||||
#define ERR_FUB_ENABLE_FALSE 65534U
|
||||
#define ERR_NOTIMPLEMENTED 9999U
|
||||
#define ERR_OK 0U
|
||||
#else
|
||||
#ifndef _GLOBAL_CONST
|
||||
#define _GLOBAL_CONST _WEAK const
|
||||
#endif
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_LINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_WSTRING;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_LWORD;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_DWORD;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_WORD;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_BYTE;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_LREAL;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_DATE;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_TIME;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_ULINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_STRING;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_REAL;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_UDINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_UINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_USINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_DINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_INT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_SINT;
|
||||
_GLOBAL_CONST unsigned short IEC_DATATYPE_BOOL;
|
||||
_GLOBAL_CONST signed long ERR_FB_NOT_IMPLEMENTED;
|
||||
_GLOBAL_CONST unsigned short ERR_FUB_REDUNDANT;
|
||||
_GLOBAL_CONST unsigned short ERR_FUB_BUSY;
|
||||
_GLOBAL_CONST unsigned short ERR_FUB_ENABLE_FALSE;
|
||||
_GLOBAL_CONST unsigned short ERR_NOTIMPLEMENTED;
|
||||
_GLOBAL_CONST unsigned short ERR_OK;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct SFCActionControl
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plctime T;
|
||||
/* VAR (analog) */
|
||||
unsigned char S_FF_SET;
|
||||
unsigned char S_FF_R1;
|
||||
unsigned char S_FF_Q;
|
||||
unsigned char dummy1;
|
||||
plctime L_TMR_PT;
|
||||
plctime L_TMR_ET;
|
||||
plctime L_TMR_STAR;
|
||||
unsigned char L_TMR_IN;
|
||||
unsigned char L_TMR_Q;
|
||||
unsigned char L_TMR_M;
|
||||
unsigned char dummy2;
|
||||
plctime D_TMR_PT;
|
||||
plctime D_TMR_ET;
|
||||
plctime D_TMR_STAR;
|
||||
unsigned char D_TMR_IN;
|
||||
unsigned char D_TMR_Q;
|
||||
unsigned char D_TMR_M;
|
||||
unsigned char dummy3;
|
||||
unsigned char P_TRIG_CLK;
|
||||
unsigned char P_TRIG_Q;
|
||||
unsigned char P_TRIG_M;
|
||||
unsigned char dummy4;
|
||||
plctime SD_TMR_PT;
|
||||
plctime SD_TMR_ET;
|
||||
plctime SD_TMR_STA;
|
||||
unsigned char SD_TMR_IN;
|
||||
unsigned char SD_TMR_Q;
|
||||
unsigned char SD_TMR_M;
|
||||
unsigned char dummy5;
|
||||
unsigned char SD_FF_SET;
|
||||
unsigned char SD_FF_R1;
|
||||
unsigned char SD_FF_Q;
|
||||
unsigned char DS_FF_SET;
|
||||
unsigned char DS_FF_R1;
|
||||
unsigned char DS_FF_Q;
|
||||
plctime DS_TMR_PT;
|
||||
plctime DS_TMR_ET;
|
||||
plctime DS_TMR_STA;
|
||||
unsigned char DS_TMR_IN;
|
||||
unsigned char DS_TMR_Q;
|
||||
unsigned char DS_TMR_M;
|
||||
unsigned char dummy6;
|
||||
unsigned char SL_FF_SET;
|
||||
unsigned char SL_FF_R1;
|
||||
unsigned char SL_FF_Q;
|
||||
unsigned char dummy7;
|
||||
plctime SL_TMR_PT;
|
||||
plctime SL_TMR_ET;
|
||||
plctime SL_TMR_STA;
|
||||
unsigned char SL_TMR_IN;
|
||||
unsigned char SL_TMR_Q;
|
||||
unsigned char SL_TMR_M;
|
||||
unsigned char dummy8;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit N;
|
||||
plcbit R0;
|
||||
plcbit S0;
|
||||
plcbit L;
|
||||
plcbit D;
|
||||
plcbit P;
|
||||
plcbit SD;
|
||||
plcbit DS;
|
||||
plcbit SL;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} SFCActionControl_typ;
|
||||
|
||||
typedef struct SFCActionType
|
||||
{ plcbit x;
|
||||
plcbit _x;
|
||||
plctime t;
|
||||
plctime _t;
|
||||
struct SFCActionControl AC;
|
||||
} SFCActionType;
|
||||
|
||||
typedef struct SFCAC2
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
plctime T;
|
||||
/* VAR (analog) */
|
||||
unsigned char S_FF_SET;
|
||||
unsigned char S_FF_R1;
|
||||
unsigned char S_FF_Q;
|
||||
plctime L_TMR_PT;
|
||||
plctime L_TMR_ET;
|
||||
plctime L_TMR_STAR;
|
||||
unsigned char L_TMR_IN;
|
||||
unsigned char L_TMR_Q;
|
||||
unsigned char L_TMR_M;
|
||||
plctime D_TMR_PT;
|
||||
plctime D_TMR_ET;
|
||||
plctime D_TMR_STAR;
|
||||
unsigned char D_TMR_IN;
|
||||
unsigned char D_TMR_Q;
|
||||
unsigned char D_TMR_M;
|
||||
plctime SD_TMR_PT;
|
||||
plctime SD_TMR_ET;
|
||||
plctime SD_TMR_STA;
|
||||
unsigned char SD_TMR_IN;
|
||||
unsigned char SD_TMR_Q;
|
||||
unsigned char SD_TMR_M;
|
||||
unsigned char SD_FF_SET;
|
||||
unsigned char SD_FF_R1;
|
||||
unsigned char SD_FF_Q1;
|
||||
unsigned char DS_FF_SET;
|
||||
unsigned char DS_FF_R1;
|
||||
unsigned char DS_FF_Q1;
|
||||
plctime DS_TMR_PT;
|
||||
plctime DS_TMR_ET;
|
||||
plctime DS_TMR_STA;
|
||||
unsigned char DS_TMR_IN;
|
||||
unsigned char DS_TMR_Q;
|
||||
unsigned char DS_TMR_M;
|
||||
unsigned char SL_FF_SET;
|
||||
unsigned char SL_FF_R1;
|
||||
unsigned char SL_FF_Q;
|
||||
plctime SL_TMR_PT;
|
||||
plctime SL_TMR_ET;
|
||||
plctime SL_TMR_STA;
|
||||
unsigned char SL_TMR_IN;
|
||||
unsigned char SL_TMR_Q;
|
||||
unsigned char SL_TMR_M;
|
||||
unsigned char P_TRIG_Q;
|
||||
unsigned char P_TRIG_M;
|
||||
unsigned char Q_TRIG_Q;
|
||||
unsigned char Q_TRIG_M;
|
||||
unsigned char P1_TRIG_Q;
|
||||
unsigned char P1_TRIG_M;
|
||||
unsigned char P0_TRIG_Q;
|
||||
unsigned char P0_TRIG_M;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit N;
|
||||
plcbit R0;
|
||||
plcbit S0;
|
||||
plcbit L;
|
||||
plcbit D;
|
||||
plcbit P;
|
||||
plcbit P1;
|
||||
plcbit P0;
|
||||
plcbit SD;
|
||||
plcbit DS;
|
||||
plcbit SL;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
plcbit A;
|
||||
} SFCAC2_typ;
|
||||
|
||||
typedef struct SFCActionType2
|
||||
{ plcbit x;
|
||||
plcbit _x;
|
||||
struct SFCAC2 AC;
|
||||
} SFCActionType2;
|
||||
|
||||
typedef struct SFCActionCType
|
||||
{ plcbit x;
|
||||
plcbit _x;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
struct SFCActionControl AC;
|
||||
} SFCActionCType;
|
||||
|
||||
typedef struct SFCActionCType2
|
||||
{ plcbit x;
|
||||
plcbit _x;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
struct SFCAC2 AC;
|
||||
} SFCActionCType2;
|
||||
|
||||
typedef struct TimerType
|
||||
{ double ptime;
|
||||
double etime;
|
||||
double start;
|
||||
unsigned char in;
|
||||
unsigned char q;
|
||||
} TimerType;
|
||||
|
||||
typedef struct SFCAC3
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
double T;
|
||||
double T_ACT;
|
||||
/* VAR (analog) */
|
||||
struct TimerType L_TMR;
|
||||
struct TimerType D_TMR;
|
||||
struct TimerType SD_TMR;
|
||||
struct TimerType DS_TMR;
|
||||
struct TimerType SL_TMR;
|
||||
unsigned char S_FF_Q1;
|
||||
unsigned char SD_FF_Q1;
|
||||
unsigned char DS_FF_Q1;
|
||||
unsigned char SL_FF_Q1;
|
||||
unsigned char P_R_TRIG_Q;
|
||||
unsigned char P_R_TRIG_M;
|
||||
unsigned char Q_F_TRIG_Q;
|
||||
unsigned char Q_F_TRIG_M;
|
||||
unsigned char P1_R_TRIG_Q;
|
||||
unsigned char P1_R_TRIG_M;
|
||||
unsigned char P0_F_TRIG_Q;
|
||||
unsigned char P0_F_TRIG_M;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit N;
|
||||
plcbit R0;
|
||||
plcbit S0;
|
||||
plcbit L;
|
||||
plcbit D;
|
||||
plcbit P;
|
||||
plcbit P1;
|
||||
plcbit P0;
|
||||
plcbit SD;
|
||||
plcbit DS;
|
||||
plcbit SL;
|
||||
plcbit PAUSE;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
plcbit A;
|
||||
} SFCAC3_typ;
|
||||
|
||||
typedef struct SFCActionCType3
|
||||
{ double t;
|
||||
double _t;
|
||||
double tp;
|
||||
plcbit x;
|
||||
plcbit _x;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
struct SFCAC3 AC;
|
||||
} SFCActionCType3;
|
||||
|
||||
typedef struct SFCStepType
|
||||
{ plcbit x;
|
||||
plctime t;
|
||||
plcbit _x;
|
||||
plctime _t;
|
||||
} SFCStepType;
|
||||
|
||||
typedef struct SFCStepCType
|
||||
{ plctime t;
|
||||
plctime _t;
|
||||
unsigned long inactive_actions;
|
||||
unsigned long _inactive_actions;
|
||||
unsigned long error_actions;
|
||||
plcbit x;
|
||||
plcbit _x;
|
||||
plcbit x_activate;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
plcbit tip;
|
||||
plcbit tip_disable_duration;
|
||||
plcbit tip_disable_action;
|
||||
} SFCStepCType;
|
||||
|
||||
typedef struct SFCStepCType3
|
||||
{ double t;
|
||||
double _t;
|
||||
double tp;
|
||||
unsigned long inactive_actions;
|
||||
unsigned long _inactive_actions;
|
||||
unsigned long error_actions;
|
||||
plcbit x;
|
||||
plcbit _x;
|
||||
plcbit x_activate;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
plcbit tip;
|
||||
plcbit tip_disable_duration;
|
||||
plcbit tip_disable_action;
|
||||
} SFCStepCType3;
|
||||
|
||||
typedef struct SFCSimpleStepCType
|
||||
{ plctime t;
|
||||
plctime _t;
|
||||
plcbit x;
|
||||
plcbit _x;
|
||||
plcbit x_activate;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
plcbit tip;
|
||||
plcbit tip_disable_duration;
|
||||
plcbit tip_disable_action;
|
||||
} SFCSimpleStepCType;
|
||||
|
||||
typedef struct SFCSimpleStepCType3
|
||||
{ double t;
|
||||
double _t;
|
||||
double tp;
|
||||
plcbit x;
|
||||
plcbit _x;
|
||||
plcbit x_activate;
|
||||
plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
plcbit error;
|
||||
plcbit tip;
|
||||
plcbit tip_disable_duration;
|
||||
plcbit tip_disable_action;
|
||||
} SFCSimpleStepCType3;
|
||||
|
||||
typedef struct SFCTransitionCType
|
||||
{ plcbit force;
|
||||
plcbit _force;
|
||||
plcbit active;
|
||||
plcbit _active;
|
||||
} SFCTransitionCType;
|
||||
|
||||
typedef struct ArFBStateInternalType
|
||||
{ unsigned long ExecuteRef;
|
||||
unsigned long BusyRef;
|
||||
unsigned long DoneRef;
|
||||
unsigned long ErrorRef;
|
||||
unsigned long ActiveRef;
|
||||
unsigned long StatusRef;
|
||||
unsigned long FBCyclic;
|
||||
unsigned long AsyfumaState;
|
||||
unsigned long FBResetOut;
|
||||
unsigned long Argument;
|
||||
unsigned long State;
|
||||
plcbit ExecutePrev;
|
||||
} ArFBStateInternalType;
|
||||
|
||||
typedef struct ArFBAsyFuMaInternalType
|
||||
{ unsigned short State;
|
||||
signed long Result;
|
||||
} ArFBAsyFuMaInternalType;
|
||||
|
||||
typedef struct r_trig
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} r_trig_typ;
|
||||
|
||||
typedef struct f_trig
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} f_trig_typ;
|
||||
|
||||
typedef struct rf_trig
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} rf_trig_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void r_trig(struct r_trig* inst);
|
||||
_BUR_PUBLIC void f_trig(struct f_trig* inst);
|
||||
_BUR_PUBLIC void rf_trig(struct rf_trig* inst);
|
||||
_BUR_PUBLIC void SFCActionControl(struct SFCActionControl* inst);
|
||||
_BUR_PUBLIC void SFCAC2(struct SFCAC2* inst);
|
||||
_BUR_PUBLIC void SFCAC3(struct SFCAC3* inst);
|
||||
_BUR_PUBLIC plctime GetTime(void);
|
||||
_BUR_PUBLIC double RealTan(double x);
|
||||
_BUR_PUBLIC double RealAtan(double x);
|
||||
_BUR_PUBLIC double RealAsin(double x);
|
||||
_BUR_PUBLIC double RealAcos(double x);
|
||||
_BUR_PUBLIC double RealExp(double x);
|
||||
_BUR_PUBLIC double RealLn(double x);
|
||||
_BUR_PUBLIC double RealLog(double x);
|
||||
_BUR_PUBLIC double RealExpt(double x, double y);
|
||||
_BUR_PUBLIC double RealAbs(double x);
|
||||
_BUR_PUBLIC double RealSin(double x);
|
||||
_BUR_PUBLIC double RealCos(double x);
|
||||
_BUR_PUBLIC double RealSqrt(double x);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _RUNTIME_ */
|
||||
|
||||
80
Logical/Libraries/runtime/SGC/runtime.h
Normal file
80
Logical/Libraries/runtime/SGC/runtime.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _RUNTIME_
|
||||
#define _RUNTIME_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define ERR_OK 0
|
||||
#define ERR_NOTIMPLEMENTED 9999
|
||||
#define ERR_FUB_ENABLE_FALSE 0xFFFE
|
||||
#define ERR_FUB_BUSY 0xFFFF
|
||||
|
||||
/* IEC 61131-3 Datentypen */
|
||||
#define IEC_DATATYPE_BOOL 1
|
||||
#define IEC_DATATYPE_SINT 2
|
||||
#define IEC_DATATYPE_INT 3
|
||||
#define IEC_DATATYPE_DINT 4
|
||||
#define IEC_DATATYPE_USINT 5
|
||||
#define IEC_DATATYPE_UINT 6
|
||||
#define IEC_DATATYPE_UDINT 7
|
||||
#define IEC_DATATYPE_REAL 8
|
||||
#define IEC_DATATYPE_STRING 9
|
||||
#define IEC_DATATYPE_ULINT 10
|
||||
#define IEC_DATATYPE_DATE_AND_TIME 11
|
||||
#define IEC_DATATYPE_TIME 12
|
||||
#define IEC_DATATYPE_DATE 13
|
||||
#define IEC_DATATYPE_LREAL 14
|
||||
#define IEC_DATATYPE_TIME_OF_DAY 16
|
||||
#define IEC_DATATYPE_BYTE 17
|
||||
#define IEC_DATATYPE_WORD 18
|
||||
#define IEC_DATATYPE_DWORD 19
|
||||
#define IEC_DATATYPE_LWORD 20
|
||||
#define IEC_DATATYPE_WSTRING 21
|
||||
#define IEC_DATATYPE_LINT 23
|
||||
|
||||
#else
|
||||
_IEC_CONST unsigned short ERR_OK = 0U;
|
||||
_IEC_CONST unsigned short ERR_NOTIMPLEMENTED = 9999U;
|
||||
_IEC_CONST unsigned short ERR_FUB_ENABLE_FALSE = 0xFFFEU;
|
||||
_IEC_CONST unsigned short ERR_FUB_BUSY = 0xFFFFU;
|
||||
|
||||
/* IEC 61131-3 Datentypen */
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_BOOL = 1;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_SINT = 2;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_INT = 3;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DINT = 4;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_USINT = 5;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_UINT = 6;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_UDINT = 7;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_REAL = 8;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_STRING = 9;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_ULINT = 10;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME = 11;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_TIME = 12;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DATE = 13;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LREAL = 14;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY = 16;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_BYTE = 17;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_WORD = 18;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_DWORD = 19;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LWORD = 20;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_WSTRING = 21;
|
||||
_IEC_CONST unsigned short IEC_DATATYPE_LINT = 23;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _RUNTIME_ */
|
||||
|
||||
9
Logical/Libraries/runtime/binary.lby
Normal file
9
Logical/Libraries/runtime/binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains runtime functions for IEC tasks." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>runtime.fun</File>
|
||||
<File>runtime.typ</File>
|
||||
<File>runtime.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
282
Logical/Libraries/runtime/runtime.fun
Normal file
282
Logical/Libraries/runtime/runtime.fun
Normal file
@@ -0,0 +1,282 @@
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK r_trig (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK f_trig (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK rf_trig (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
FUNCTION GetTime : TIME (*for internal use only - do not use this function in user programs*)
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION_BLOCK SFCActionControl (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
N :BOOL;
|
||||
R0 :BOOL;
|
||||
S0 :BOOL;
|
||||
L :BOOL;
|
||||
D :BOOL;
|
||||
P :BOOL;
|
||||
SD :BOOL;
|
||||
DS :BOOL;
|
||||
SL :BOOL;
|
||||
T :TIME;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
S_FF_SET :USINT;
|
||||
S_FF_R1 :USINT;
|
||||
S_FF_Q :USINT;
|
||||
dummy1 :USINT;
|
||||
L_TMR_PT :TIME;
|
||||
L_TMR_ET :TIME;
|
||||
L_TMR_STAR :TIME;
|
||||
L_TMR_IN :USINT;
|
||||
L_TMR_Q :USINT;
|
||||
L_TMR_M :USINT;
|
||||
dummy2 :USINT;
|
||||
D_TMR_PT :TIME;
|
||||
D_TMR_ET :TIME;
|
||||
D_TMR_STAR :TIME;
|
||||
D_TMR_IN :USINT;
|
||||
D_TMR_Q :USINT;
|
||||
D_TMR_M :USINT;
|
||||
dummy3 :USINT;
|
||||
P_TRIG_CLK :USINT;
|
||||
P_TRIG_Q :USINT;
|
||||
P_TRIG_M :USINT;
|
||||
dummy4 :USINT;
|
||||
SD_TMR_PT :TIME;
|
||||
SD_TMR_ET :TIME;
|
||||
SD_TMR_STA :TIME;
|
||||
SD_TMR_IN :USINT;
|
||||
SD_TMR_Q :USINT;
|
||||
SD_TMR_M :USINT;
|
||||
dummy5 :USINT;
|
||||
SD_FF_SET :USINT;
|
||||
SD_FF_R1 :USINT;
|
||||
SD_FF_Q :USINT;
|
||||
DS_FF_SET :USINT;
|
||||
DS_FF_R1 :USINT;
|
||||
DS_FF_Q :USINT;
|
||||
DS_TMR_PT :TIME;
|
||||
DS_TMR_ET :TIME;
|
||||
DS_TMR_STA :TIME;
|
||||
DS_TMR_IN :USINT;
|
||||
DS_TMR_Q :USINT;
|
||||
DS_TMR_M :USINT;
|
||||
dummy6 :USINT;
|
||||
SL_FF_SET :USINT;
|
||||
SL_FF_R1 :USINT;
|
||||
SL_FF_Q :USINT;
|
||||
dummy7 :USINT;
|
||||
SL_TMR_PT :TIME;
|
||||
SL_TMR_ET :TIME;
|
||||
SL_TMR_STA :TIME;
|
||||
SL_TMR_IN :USINT;
|
||||
SL_TMR_Q :USINT;
|
||||
SL_TMR_M :USINT;
|
||||
dummy8 :USINT;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK SFCAC2 (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
N : {REDUND_UNREPLICABLE} BOOL;
|
||||
R0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
S0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
L : {REDUND_UNREPLICABLE} BOOL;
|
||||
D : {REDUND_UNREPLICABLE} BOOL;
|
||||
P : {REDUND_UNREPLICABLE} BOOL;
|
||||
P1 : {REDUND_UNREPLICABLE} BOOL;
|
||||
P0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
SD : {REDUND_UNREPLICABLE} BOOL;
|
||||
DS : {REDUND_UNREPLICABLE} BOOL;
|
||||
SL : {REDUND_UNREPLICABLE} BOOL;
|
||||
T :TIME;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL;
|
||||
A :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
S_FF_SET :USINT;
|
||||
S_FF_R1 :USINT;
|
||||
S_FF_Q :USINT;
|
||||
L_TMR_PT :TIME;
|
||||
L_TMR_ET :TIME;
|
||||
L_TMR_STAR :TIME;
|
||||
L_TMR_IN :USINT;
|
||||
L_TMR_Q :USINT;
|
||||
L_TMR_M :USINT;
|
||||
D_TMR_PT :TIME;
|
||||
D_TMR_ET :TIME;
|
||||
D_TMR_STAR :TIME;
|
||||
D_TMR_IN :USINT;
|
||||
D_TMR_Q :USINT;
|
||||
D_TMR_M :USINT;
|
||||
SD_TMR_PT :TIME;
|
||||
SD_TMR_ET :TIME;
|
||||
SD_TMR_STA :TIME;
|
||||
SD_TMR_IN :USINT;
|
||||
SD_TMR_Q :USINT;
|
||||
SD_TMR_M :USINT;
|
||||
SD_FF_SET :USINT;
|
||||
SD_FF_R1 :USINT;
|
||||
SD_FF_Q1 :USINT;
|
||||
DS_FF_SET :USINT;
|
||||
DS_FF_R1 :USINT;
|
||||
DS_FF_Q1 :USINT;
|
||||
DS_TMR_PT :TIME;
|
||||
DS_TMR_ET :TIME;
|
||||
DS_TMR_STA :TIME;
|
||||
DS_TMR_IN :USINT;
|
||||
DS_TMR_Q :USINT;
|
||||
DS_TMR_M :USINT;
|
||||
SL_FF_SET :USINT;
|
||||
SL_FF_R1 :USINT;
|
||||
SL_FF_Q :USINT;
|
||||
SL_TMR_PT :TIME;
|
||||
SL_TMR_ET :TIME;
|
||||
SL_TMR_STA :TIME;
|
||||
SL_TMR_IN :USINT;
|
||||
SL_TMR_Q :USINT;
|
||||
SL_TMR_M :USINT;
|
||||
P_TRIG_Q :USINT;
|
||||
P_TRIG_M :USINT;
|
||||
Q_TRIG_Q :USINT;
|
||||
Q_TRIG_M :USINT;
|
||||
P1_TRIG_Q :USINT;
|
||||
P1_TRIG_M :USINT;
|
||||
P0_TRIG_Q :USINT;
|
||||
P0_TRIG_M :USINT;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION RealTan : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealAtan : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealAsin : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealAcos : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealExp : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealLn : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealLog : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealExpt : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
y :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealAbs : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealSin : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealCos : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION RealSqrt : LREAL
|
||||
VAR_INPUT
|
||||
x :LREAL;
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} FUNCTION_BLOCK SFCAC3 (*for internal use only - do not use this function in user programs*)
|
||||
VAR_INPUT
|
||||
N : {REDUND_UNREPLICABLE} BOOL;
|
||||
R0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
S0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
L : {REDUND_UNREPLICABLE} BOOL;
|
||||
D : {REDUND_UNREPLICABLE} BOOL;
|
||||
P : {REDUND_UNREPLICABLE} BOOL;
|
||||
P1 : {REDUND_UNREPLICABLE} BOOL;
|
||||
P0 : {REDUND_UNREPLICABLE} BOOL;
|
||||
SD : {REDUND_UNREPLICABLE} BOOL;
|
||||
DS : {REDUND_UNREPLICABLE} BOOL;
|
||||
SL : {REDUND_UNREPLICABLE} BOOL;
|
||||
T :LREAL;
|
||||
T_ACT : {REDUND_UNREPLICABLE} LREAL;
|
||||
PAUSE : {REDUND_UNREPLICABLE} BOOL;
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q : {REDUND_UNREPLICABLE} BOOL;
|
||||
A :BOOL;
|
||||
END_VAR
|
||||
VAR
|
||||
L_TMR :TimerType;
|
||||
D_TMR :TimerType;
|
||||
SD_TMR :TimerType;
|
||||
DS_TMR :TimerType;
|
||||
SL_TMR :TimerType;
|
||||
S_FF_Q1 :USINT;
|
||||
SD_FF_Q1 :USINT;
|
||||
DS_FF_Q1 :USINT;
|
||||
SL_FF_Q1 :USINT;
|
||||
P_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
|
||||
P_R_TRIG_M :USINT;
|
||||
Q_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
|
||||
Q_F_TRIG_M :USINT;
|
||||
P1_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
|
||||
P1_R_TRIG_M :USINT;
|
||||
P0_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
|
||||
P0_F_TRIG_M :USINT;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
156
Logical/Libraries/runtime/runtime.typ
Normal file
156
Logical/Libraries/runtime/runtime.typ
Normal file
@@ -0,0 +1,156 @@
|
||||
|
||||
TYPE
|
||||
SFCActionType : STRUCT (*internal use*)
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
t : TIME;
|
||||
_t : TIME;
|
||||
AC : SFCActionControl;
|
||||
END_STRUCT;
|
||||
SFCActionType2 : STRUCT (*internal use*)
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
AC : SFCAC2;
|
||||
END_STRUCT;
|
||||
SFCActionCType : STRUCT (*internal use*)
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
AC : SFCActionControl;
|
||||
END_STRUCT;
|
||||
SFCActionCType2 : STRUCT (*internal use*)
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
AC : SFCAC2;
|
||||
END_STRUCT;
|
||||
SFCActionCType3 : STRUCT (*internal use*)
|
||||
t : LREAL;
|
||||
_t : LREAL;
|
||||
tp : LREAL;
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
AC : SFCAC3;
|
||||
END_STRUCT;
|
||||
SFCStepType : STRUCT (*internal use*)
|
||||
x : BOOL;
|
||||
t : TIME;
|
||||
_x : BOOL;
|
||||
_t : TIME;
|
||||
END_STRUCT;
|
||||
SFCStepCType : STRUCT (*internal use*)
|
||||
t : TIME;
|
||||
_t : TIME;
|
||||
inactive_actions : UDINT;
|
||||
_inactive_actions : UDINT;
|
||||
error_actions : UDINT;
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
x_activate : BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
tip : BOOL;
|
||||
tip_disable_duration: BOOL;
|
||||
tip_disable_action : BOOL;
|
||||
END_STRUCT;
|
||||
SFCStepCType3 : STRUCT (*internal use*)
|
||||
t : LREAL;
|
||||
_t : LREAL;
|
||||
tp : LREAL;
|
||||
inactive_actions : UDINT;
|
||||
_inactive_actions : UDINT;
|
||||
error_actions : UDINT;
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
x_activate : {REDUND_UNREPLICABLE} BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
tip : BOOL;
|
||||
tip_disable_duration : BOOL;
|
||||
tip_disable_action : BOOL;
|
||||
END_STRUCT;
|
||||
SFCSimpleStepCType : STRUCT (*internal use*)
|
||||
t : TIME;
|
||||
_t : TIME;
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
x_activate : BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
tip : BOOL;
|
||||
tip_disable_duration : BOOL;
|
||||
tip_disable_action : BOOL;
|
||||
END_STRUCT;
|
||||
SFCSimpleStepCType3 : STRUCT (*internal use*)
|
||||
t : LREAL;
|
||||
_t : LREAL;
|
||||
tp : LREAL;
|
||||
x : BOOL;
|
||||
_x : BOOL;
|
||||
x_activate : {REDUND_UNREPLICABLE} BOOL;
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
error : BOOL;
|
||||
tip : BOOL;
|
||||
tip_disable_duration : BOOL;
|
||||
tip_disable_action : BOOL;
|
||||
END_STRUCT;
|
||||
SFCTransitionCType : STRUCT (*internal use*)
|
||||
force : BOOL;
|
||||
_force : BOOL;
|
||||
active : BOOL;
|
||||
_active : BOOL;
|
||||
END_STRUCT;
|
||||
TimerType : STRUCT (*internal use*)
|
||||
ptime : LREAL;
|
||||
etime : LREAL;
|
||||
start : LREAL;
|
||||
in : USINT;
|
||||
q : USINT;
|
||||
END_STRUCT;
|
||||
|
||||
ArFBStateInternalType : STRUCT (*fb state machine internal context*)
|
||||
ExecuteRef : UDINT;
|
||||
BusyRef : UDINT;
|
||||
DoneRef : UDINT;
|
||||
ErrorRef : UDINT;
|
||||
ActiveRef : UDINT;
|
||||
StatusRef : UDINT;
|
||||
FBCyclic : UDINT;
|
||||
AsyfumaState : UDINT;
|
||||
FBResetOut : UDINT;
|
||||
Argument : UDINT;
|
||||
State : UDINT;
|
||||
ExecutePrev : BOOL;
|
||||
END_STRUCT;
|
||||
|
||||
ArFBAsyFuMaInternalType : STRUCT (*asynchronous function manager internal context*)
|
||||
State : UINT;
|
||||
Result : DINT;
|
||||
END_STRUCT;
|
||||
|
||||
END_TYPE
|
||||
35
Logical/Libraries/runtime/runtime.var
Normal file
35
Logical/Libraries/runtime/runtime.var
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
(*Common Functionblock Status*)
|
||||
VAR CONSTANT
|
||||
ERR_OK : UINT := 0; (*no error*)
|
||||
ERR_NOTIMPLEMENTED : UINT := 9999; (*function or function block not implemented*)
|
||||
ERR_FUB_ENABLE_FALSE : UINT := 16#FFFE; (*function block parameter "enable" is FALSE*)
|
||||
ERR_FUB_BUSY : UINT := 16#FFFF; (*function block still working*)
|
||||
ERR_FUB_REDUNDANT : UINT := 35688; (*This FUB can not be used on the standby CPU*)
|
||||
ERR_FB_NOT_IMPLEMENTED: DINT := -1070585592;(*function or function block not implemented for the target system*)
|
||||
END_VAR
|
||||
|
||||
(*IEC 61131-3 Datatypes*)
|
||||
VAR CONSTANT
|
||||
IEC_DATATYPE_BOOL : UINT := 1; (*8 Bit containing a boolean value FALSE=0 or TRUE=1*)
|
||||
IEC_DATATYPE_SINT : UINT := 2; (*8 Bit signed integer*)
|
||||
IEC_DATATYPE_INT : UINT := 3; (*16 Bit signed integer*)
|
||||
IEC_DATATYPE_DINT : UINT := 4; (*32 Bit signed integer*)
|
||||
IEC_DATATYPE_USINT : UINT := 5; (*8 Bit unsigned integer*)
|
||||
IEC_DATATYPE_UINT : UINT := 6; (*16 Bit unsigned integer*)
|
||||
IEC_DATATYPE_UDINT : UINT := 7; (*32 Bit unsigned integer*)
|
||||
IEC_DATATYPE_REAL : UINT := 8; (*32 Bit floating point number*)
|
||||
IEC_DATATYPE_STRING : UINT := 9; (*Variable-length single-byte character string*)
|
||||
IEC_DATATYPE_ULINT : UINT := 10; (*64 Bit unsigned integer*)
|
||||
IEC_DATATYPE_DATE_AND_TIME : UINT := 11; (*32 Bit of Date in Seconds since 01.01.1970 00:00:00*)
|
||||
IEC_DATATYPE_TIME : UINT := 12; (*32 Bit of Time in ms*)
|
||||
IEC_DATATYPE_DATE : UINT := 13; (*32 Bit of Date (only)*)
|
||||
IEC_DATATYPE_LREAL : UINT := 14; (*64 Bit floating point number*)
|
||||
IEC_DATATYPE_TIME_OF_DAY: UINT := 16; (*32 Bit Time of day (only)*)
|
||||
IEC_DATATYPE_BYTE : UINT := 17; (*Bit string of length 8*)
|
||||
IEC_DATATYPE_WORD : UINT := 18; (*Bit string of length 16*)
|
||||
IEC_DATATYPE_DWORD : UINT := 19; (*Bit string of length 32*)
|
||||
IEC_DATATYPE_LWORD : UINT := 20; (*Bit string of length 64*)
|
||||
IEC_DATATYPE_WSTRING : UINT := 21; (*Variable-length double-byte character string*)
|
||||
IEC_DATATYPE_LINT : UINT := 23; (*64 Bit signed integer*)
|
||||
END_VAR
|
||||
262
Logical/Libraries/standard/SG3/standard.h
Normal file
262
Logical/Libraries/standard/SG3/standard.h
Normal file
@@ -0,0 +1,262 @@
|
||||
/* Automation Studio Generated Header File, Format Version 1.00 */
|
||||
/* do not change */
|
||||
#ifndef STANDARD_H_
|
||||
#define STANDARD_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <bur/plc.h>
|
||||
|
||||
#define TP_10mstyp TP_10ms_typ
|
||||
#define TOF_10mstyp TOF_10ms_typ
|
||||
#define TON_10mstyp TON_10ms_typ
|
||||
#define TPtyp TP_typ
|
||||
#define TOFtyp TOF_typ
|
||||
#define TONtyp TON_typ
|
||||
#define SEMAtyp SEMA_typ
|
||||
#define RStyp RS_typ
|
||||
#define SRtyp SR_typ
|
||||
#define R_TRIGtyp R_TRIG_typ
|
||||
#define F_TRIGtyp F_TRIG_typ
|
||||
#define CTUtyp CTU_typ
|
||||
#define CTDtyp CTD_typ
|
||||
#define CTUDtyp CTUD_typ
|
||||
#define RF_TRIGtyp RF_TRIG_typ
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
typedef struct TP_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_10ms_typ;
|
||||
|
||||
typedef struct TOF_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_10ms_typ;
|
||||
|
||||
typedef struct TON_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_10ms_typ;
|
||||
|
||||
typedef struct TP
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_typ;
|
||||
|
||||
typedef struct TOF
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_typ;
|
||||
|
||||
typedef struct TON
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_typ;
|
||||
|
||||
typedef struct SEMA
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLAIM;
|
||||
plcbit RELEASE;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit BUSY;
|
||||
/* VAR (digital) */
|
||||
plcbit X;
|
||||
} SEMA_typ;
|
||||
|
||||
typedef struct RS
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET;
|
||||
plcbit RESET1;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} RS_typ;
|
||||
|
||||
typedef struct SR
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET1;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} SR_typ;
|
||||
|
||||
typedef struct R_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} R_TRIG_typ;
|
||||
|
||||
typedef struct F_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} F_TRIG_typ;
|
||||
|
||||
typedef struct CTU
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTU_typ;
|
||||
|
||||
typedef struct CTD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CD;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTD_typ;
|
||||
|
||||
typedef struct CTUD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
signed short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
signed short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit CD;
|
||||
plcbit RESET;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit QU;
|
||||
plcbit QD;
|
||||
/* VAR (digital) */
|
||||
plcbit MU;
|
||||
plcbit MD;
|
||||
} CTUD_typ;
|
||||
|
||||
typedef struct RF_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} RF_TRIG_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void TP_10ms(TP_10ms_typ* inst);
|
||||
void TOF_10ms(TOF_10ms_typ* inst);
|
||||
void TON_10ms(TON_10ms_typ* inst);
|
||||
void TP(TP_typ* inst);
|
||||
void TOF(TOF_typ* inst);
|
||||
void TON(TON_typ* inst);
|
||||
void SEMA(SEMA_typ* inst);
|
||||
void RS(RS_typ* inst);
|
||||
void SR(SR_typ* inst);
|
||||
void R_TRIG(R_TRIG_typ* inst);
|
||||
void F_TRIG(F_TRIG_typ* inst);
|
||||
void CTU(CTU_typ* inst);
|
||||
void CTD(CTD_typ* inst);
|
||||
void CTUD(CTUD_typ* inst);
|
||||
void RF_TRIG(RF_TRIG_typ* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* STANDARD_H_ */
|
||||
|
||||
267
Logical/Libraries/standard/SG4/standard.h
Normal file
267
Logical/Libraries/standard/SG4/standard.h
Normal file
@@ -0,0 +1,267 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef STANDARD_H_
|
||||
#define STANDARD_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _BUR_PUBLIC
|
||||
#define _BUR_PUBLIC
|
||||
#endif
|
||||
|
||||
#define TP_10mstyp TP_10ms_typ
|
||||
#define TOF_10mstyp TOF_10ms_typ
|
||||
#define TON_10mstyp TON_10ms_typ
|
||||
#define TPtyp TP_typ
|
||||
#define TOFtyp TOF_typ
|
||||
#define TONtyp TON_typ
|
||||
#define SEMAtyp SEMA_typ
|
||||
#define RStyp RS_typ
|
||||
#define SRtyp SR_typ
|
||||
#define R_TRIGtyp R_TRIG_typ
|
||||
#define F_TRIGtyp F_TRIG_typ
|
||||
#define CTUtyp CTU_typ
|
||||
#define CTDtyp CTD_typ
|
||||
#define CTUDtyp CTUD_typ
|
||||
#define RF_TRIGtyp RF_TRIG_typ
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
typedef struct TP_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_10ms_typ;
|
||||
|
||||
typedef struct TOF_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_10ms_typ;
|
||||
|
||||
typedef struct TON_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_10ms_typ;
|
||||
|
||||
typedef struct TP
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_typ;
|
||||
|
||||
typedef struct TOF
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_typ;
|
||||
|
||||
typedef struct TON
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_typ;
|
||||
|
||||
typedef struct SEMA
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLAIM;
|
||||
plcbit RELEASE;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit BUSY;
|
||||
/* VAR (digital) */
|
||||
plcbit X;
|
||||
} SEMA_typ;
|
||||
|
||||
typedef struct RS
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET;
|
||||
plcbit RESET1;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} RS_typ;
|
||||
|
||||
typedef struct SR
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET1;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} SR_typ;
|
||||
|
||||
typedef struct R_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} R_TRIG_typ;
|
||||
|
||||
typedef struct F_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} F_TRIG_typ;
|
||||
|
||||
typedef struct CTU
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTU_typ;
|
||||
|
||||
typedef struct CTD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CD;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTD_typ;
|
||||
|
||||
typedef struct CTUD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
signed short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
signed short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit CD;
|
||||
plcbit RESET;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit QU;
|
||||
plcbit QD;
|
||||
/* VAR (digital) */
|
||||
plcbit MU;
|
||||
plcbit MD;
|
||||
} CTUD_typ;
|
||||
|
||||
typedef struct RF_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} RF_TRIG_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
_BUR_PUBLIC void TP_10ms(TP_10ms_typ* inst);
|
||||
_BUR_PUBLIC void TOF_10ms(TOF_10ms_typ* inst);
|
||||
_BUR_PUBLIC void TON_10ms(TON_10ms_typ* inst);
|
||||
_BUR_PUBLIC void TP(TP_typ* inst);
|
||||
_BUR_PUBLIC void TOF(TOF_typ* inst);
|
||||
_BUR_PUBLIC void TON(TON_typ* inst);
|
||||
_BUR_PUBLIC void SEMA(SEMA_typ* inst);
|
||||
_BUR_PUBLIC void RS(RS_typ* inst);
|
||||
_BUR_PUBLIC void SR(SR_typ* inst);
|
||||
_BUR_PUBLIC void R_TRIG(R_TRIG_typ* inst);
|
||||
_BUR_PUBLIC void F_TRIG(F_TRIG_typ* inst);
|
||||
_BUR_PUBLIC void CTU(CTU_typ* inst);
|
||||
_BUR_PUBLIC void CTD(CTD_typ* inst);
|
||||
_BUR_PUBLIC void CTUD(CTUD_typ* inst);
|
||||
_BUR_PUBLIC void RF_TRIG(RF_TRIG_typ* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* STANDARD_H_ */
|
||||
|
||||
262
Logical/Libraries/standard/SGC/standard.h
Normal file
262
Logical/Libraries/standard/SGC/standard.h
Normal file
@@ -0,0 +1,262 @@
|
||||
/* Automation Studio Generated Header File, Format Version 1.00 */
|
||||
/* do not change */
|
||||
#ifndef STANDARD_H_
|
||||
#define STANDARD_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <bur/plc.h>
|
||||
|
||||
#define TP_10mstyp TP_10ms_typ
|
||||
#define TOF_10mstyp TOF_10ms_typ
|
||||
#define TON_10mstyp TON_10ms_typ
|
||||
#define TPtyp TP_typ
|
||||
#define TOFtyp TOF_typ
|
||||
#define TONtyp TON_typ
|
||||
#define SEMAtyp SEMA_typ
|
||||
#define RStyp RS_typ
|
||||
#define SRtyp SR_typ
|
||||
#define R_TRIGtyp R_TRIG_typ
|
||||
#define F_TRIGtyp F_TRIG_typ
|
||||
#define CTUtyp CTU_typ
|
||||
#define CTDtyp CTD_typ
|
||||
#define CTUDtyp CTUD_typ
|
||||
#define RF_TRIGtyp RF_TRIG_typ
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
typedef struct TP_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_10ms_typ;
|
||||
|
||||
typedef struct TOF_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_10ms_typ;
|
||||
|
||||
typedef struct TON_10ms
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned long PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned long ET;
|
||||
/* VAR (analogous) */
|
||||
unsigned long StartTime;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_10ms_typ;
|
||||
|
||||
typedef struct TP
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
} TP_typ;
|
||||
|
||||
typedef struct TOF
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TOF_typ;
|
||||
|
||||
typedef struct TON
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
plctime PT;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
plctime ET;
|
||||
/* VAR (analogous) */
|
||||
plctime StartTime;
|
||||
unsigned long Restart;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit IN;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} TON_typ;
|
||||
|
||||
typedef struct SEMA
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLAIM;
|
||||
plcbit RELEASE;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit BUSY;
|
||||
/* VAR (digital) */
|
||||
plcbit X;
|
||||
} SEMA_typ;
|
||||
|
||||
typedef struct RS
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET;
|
||||
plcbit RESET1;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} RS_typ;
|
||||
|
||||
typedef struct SR
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit SET1;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q1;
|
||||
} SR_typ;
|
||||
|
||||
typedef struct R_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} R_TRIG_typ;
|
||||
|
||||
typedef struct F_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} F_TRIG_typ;
|
||||
|
||||
typedef struct CTU
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit RESET;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTU_typ;
|
||||
|
||||
typedef struct CTD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
unsigned short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
unsigned short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CD;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} CTD_typ;
|
||||
|
||||
typedef struct CTUD
|
||||
{
|
||||
/* VAR_INPUT (analogous) */
|
||||
signed short PV;
|
||||
/* VAR_OUTPUT (analogous) */
|
||||
signed short CV;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CU;
|
||||
plcbit CD;
|
||||
plcbit RESET;
|
||||
plcbit LOAD;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit QU;
|
||||
plcbit QD;
|
||||
/* VAR (digital) */
|
||||
plcbit MU;
|
||||
plcbit MD;
|
||||
} CTUD_typ;
|
||||
|
||||
typedef struct RF_TRIG
|
||||
{
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit CLK;
|
||||
/* VAR_OUTPUT (digital) */
|
||||
plcbit Q;
|
||||
/* VAR (digital) */
|
||||
plcbit M;
|
||||
} RF_TRIG_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void TP_10ms(TP_10ms_typ* inst);
|
||||
void TOF_10ms(TOF_10ms_typ* inst);
|
||||
void TON_10ms(TON_10ms_typ* inst);
|
||||
void TP(TP_typ* inst);
|
||||
void TOF(TOF_typ* inst);
|
||||
void TON(TON_typ* inst);
|
||||
void SEMA(SEMA_typ* inst);
|
||||
void RS(RS_typ* inst);
|
||||
void SR(SR_typ* inst);
|
||||
void R_TRIG(R_TRIG_typ* inst);
|
||||
void F_TRIG(F_TRIG_typ* inst);
|
||||
void CTU(CTU_typ* inst);
|
||||
void CTD(CTD_typ* inst);
|
||||
void CTUD(CTUD_typ* inst);
|
||||
void RF_TRIG(RF_TRIG_typ* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* STANDARD_H_ */
|
||||
|
||||
9
Logical/Libraries/standard/binary.lby
Normal file
9
Logical/Libraries/standard/binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<Library SubType="binary" Description="This library contains standard function blocks and functions for IEC 61131-3." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>standard.fun</File>
|
||||
<File>standard.typ</File>
|
||||
<File>standard.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
253
Logical/Libraries/standard/standard.fun
Normal file
253
Logical/Libraries/standard/standard.fun
Normal file
@@ -0,0 +1,253 @@
|
||||
|
||||
{REDUND_OK} FUNCTION_BLOCK RF_TRIG (*recognizes both edges of BOOL values*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL; (*input signal of the edge to be recognized*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*TRUE if the input signal was FALSE on the last call and is now TRUE*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK CTUD (*counts upward or downward*)
|
||||
VAR_INPUT
|
||||
CU :BOOL; (*counter CV is increased by 1 by CU when the edge is rising*)
|
||||
CD :BOOL; (*counter CV is reduced by 1 by CD when the edge is rising*)
|
||||
RESET :BOOL; (*counter CV is set to 0 if RESET is TRUE*)
|
||||
LOAD :BOOL; (*if LOAD is TRUE, then counter CV is initialized with the starting value PV*)
|
||||
PV :INT; (*start value*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
QU :BOOL; (*is TRUE if CV is greater than or equal to PV*)
|
||||
QD :BOOL; (*is TRUE if CV equals 0*)
|
||||
CV :INT; (*counter*)
|
||||
END_VAR
|
||||
VAR
|
||||
MU :BOOL; (*internal variable*)
|
||||
MD :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK CTD (*counts downward*)
|
||||
VAR_INPUT
|
||||
CD :BOOL; (*counter CV is reduced by 1 by CD when the edge is rising*)
|
||||
LOAD :BOOL; (*if LOAD is TRUE, then counter CV is initialized with the starting value PV*)
|
||||
PV :UINT; (*start value*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*is TRUE if CV equals 0*)
|
||||
CV :UINT; (*counter*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK CTU (*counts upward*)
|
||||
VAR_INPUT
|
||||
CU :BOOL; (*counter CV is increased by 1 by CU when the edge is rising*)
|
||||
RESET :BOOL; (*counter CV is set to 0 if RESET is TRUE*)
|
||||
PV :UINT; (*comparison variable*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*is TRUE if counter CV is greater than or equal to the PV comparison variable*)
|
||||
CV :UINT; (*counter*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK F_TRIG (*recognizes falling edges from BOOL values*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL; (*input signal whose edge should be detected*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*is set to TRUE if the input signal was TRUE during the last call and is now FALSE*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK R_TRIG (*recognizes rising edges from BOOL values*)
|
||||
VAR_INPUT
|
||||
CLK :BOOL; (*input signal whose edge should be detected*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*is set to TRUE if the input signal was FALSE during the last call and is now TRUE*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK SR (*sets or resets the output (set has priority)*)
|
||||
VAR_INPUT
|
||||
SET1 :BOOL; (*sets output Q1 (priority)*)
|
||||
RESET :BOOL; (*resets output Q1*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q1 :BOOL; (*output value *)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK RS (*sets or resets the output (reset has priority)*)
|
||||
VAR_INPUT
|
||||
SET :BOOL; (*sets output Q1*)
|
||||
RESET1 :BOOL; (*resets output Q1 (priority)*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q1 :BOOL; (*output value*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK SEMA (*blocks access within the same task class (simple semaphore)*)
|
||||
VAR_INPUT
|
||||
CLAIM :BOOL; (*locks semaphore*)
|
||||
RELEASE :BOOL; (*releases semaphore*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
BUSY :BOOL; (*TRUE if the semaphore was already locked*)
|
||||
END_VAR
|
||||
VAR
|
||||
X :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TON (*implements a switch on delay*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :TIME; (*delay time*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*rising edge of the input signal is delayed by PT*)
|
||||
ET :TIME; (*elapsed time*)
|
||||
END_VAR
|
||||
VAR
|
||||
StartTime :TIME; (*internal variable*)
|
||||
M :BOOL; (*internal variable*)
|
||||
Restart : {REDUND_UNREPLICABLE} UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TOF (*implements a switch off delay*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :TIME; (*delay time*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*falling edge of the input signal is delayed by PT*)
|
||||
ET :TIME; (*elapsed time*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
StartTime :TIME; (*internal variable*)
|
||||
Restart : {REDUND_UNREPLICABLE} UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TP (*implements a pulse generator*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :TIME; (*pulse time*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*output signal*)
|
||||
ET :TIME; (*elapsed time*)
|
||||
END_VAR
|
||||
VAR
|
||||
StartTime :TIME; (*internal variable*)
|
||||
Restart : {REDUND_UNREPLICABLE} UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TON_10ms (*implements a switch on delay based on 10 ms steps*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :UDINT; (*delay time in 10 ms steps*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*output signal, the rising edge of the input signal is delayed by PT*)
|
||||
ET :UDINT; (*elapsed time in 10 ms increments*)
|
||||
END_VAR
|
||||
VAR
|
||||
StartTime :UDINT; (*internal variable*)
|
||||
M :BOOL; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TOF_10ms (*implements a switch off delay based on 10 ms steps*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :UDINT; (*delay time in 10 ms steps*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*output signal, the falling edge of the input signal is delayed by PT*)
|
||||
ET :UDINT; (*elapsed time in 10 ms increments*)
|
||||
END_VAR
|
||||
VAR
|
||||
M :BOOL; (*internal variable*)
|
||||
StartTime :UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} FUNCTION_BLOCK TP_10ms (*implements a pulse using 10 ms steps*)
|
||||
VAR_INPUT
|
||||
IN :BOOL; (*input signal*)
|
||||
PT :UDINT; (*pulse time in 10 ms steps*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
Q :BOOL; (*output signal*)
|
||||
ET :UDINT; (*elapsed time in 10 ms increments*)
|
||||
END_VAR
|
||||
VAR
|
||||
StartTime :UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LEN : INT (*calculates the length of a string*)
|
||||
VAR_INPUT
|
||||
IN :STRING[32767]; (*input string*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION LEFT : STRING[255] (*extracts a certain amount (L) of leftmost characters from a string*)
|
||||
VAR_INPUT
|
||||
IN :STRING[32767]; (*input string*)
|
||||
L :INT; (*number of characters*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION RIGHT : STRING[255] (*extracts a certain amount (L) of rightmost characters from a string*)
|
||||
VAR_INPUT
|
||||
IN :STRING[32767]; (*input string*)
|
||||
L :INT; (*number of characters*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION MID : STRING[255] (*extracts L number of characters out of string beginning with position P*)
|
||||
VAR_INPUT
|
||||
IN :STRING[32767]; (*string which should be extracted from*)
|
||||
L :INT; (*number of characters*)
|
||||
P :INT; (*position of the first character which should be extracted*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION CONCAT : STRING[255] (*attaches strings to one another*)
|
||||
VAR_INPUT
|
||||
IN1 :STRING[32767]; (*first input string*)
|
||||
IN2 :STRING[32767]; (*second input string*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION INSERT : STRING[255] (*inserts a string into a string*)
|
||||
VAR_INPUT
|
||||
IN1 :STRING[32767]; (*string which should be inserted into*)
|
||||
IN2 :STRING[32767]; (*string which should be inserted*)
|
||||
P :INT; (*position where insertion should take place*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION DELETE : STRING[255] (*deletes L number of characters from the IN string beginning with the Pth character position*)
|
||||
VAR_INPUT
|
||||
IN :STRING[32767]; (*input string*)
|
||||
L :INT; (*number of characters to be deleted*)
|
||||
P :INT; (*starting position of characters to be deleted*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION REPLACE : STRING[255] (*replaces characters in a string*)
|
||||
VAR_INPUT
|
||||
IN1 :STRING[32767]; (*string which should have characters replaced*)
|
||||
IN2 :STRING[32767]; (*string used for the replacement*)
|
||||
L :INT; (*length of the area to be replaced*)
|
||||
P :INT; (*starting position of replacement*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION FIND : INT (*determines the position of a string inside a string*)
|
||||
VAR_INPUT
|
||||
IN1 :STRING[32767]; (*string which should be looked through*)
|
||||
IN2 :STRING[32767]; (*string which should be looked for*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
4
Logical/Libraries/standard/standard.typ
Normal file
4
Logical/Libraries/standard/standard.typ
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
4
Logical/Libraries/standard/standard.var
Normal file
4
Logical/Libraries/standard/standard.var
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
19
Logical/Machine/AIRConf/DataObject.dat
Normal file
19
Logical/Machine/AIRConf/DataObject.dat
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
; Formaler Aufbau einer Zeile des Datenmoduls
|
||||
;--------------------
|
||||
;EventPV, Funktionscode, Stationsnummer, DataPV, Offset, L<>nge
|
||||
; Offset und L<>nge sind UDINT ---> 4 Stellig angeben
|
||||
;--------------------
|
||||
"", 4, 1, "ConMon:AirValues.iParticle25", 0016, 0001
|
||||
"", 4, 1, "ConMon:AirValues.iParticle10", 0017, 0001
|
||||
;Befehle
|
||||
;"ConMon:CPEValues.OutPower.bProcess", 5, 1, "ConMon:CPEValues.OutPower.bValue", 512, 0001
|
||||
;"ConMon:CPEValues.OutKeyLock.bProcess", 5, 1, "ConMon:CPEValues.OutKeyLock.bValue", 513, 0001
|
||||
;Sollwerte
|
||||
;"ConMon:CPEValues.OutTemperatureSet.bProcess", 16, 1, "ConMon:CPEValues.OutTemperatureSet.iValue", 771, 0001
|
||||
;EventP
|
||||
;EventPV = 0 Eintrag nicht bearbeitet (<28>bersprungen)
|
||||
;EventPV = 1 Eintrag wird bearbeitet
|
||||
;Bei Erhalt des Response-Frame ohne Fehler wird die zugeh<65>rige EventPV einmalig auf 0 gesetzt.
|
||||
;Als EventPV werden die Variablentypen BOOL, SINT und USINT unterst<73>tzt, wobei die L<>nge des Eintrages beliebig sein kann
|
||||
;und zus<75>tzlich auch dynamische PV (Wichtig: Angabe mit *) unterst<73>tzt werden. Wird keine EventPV angegeben, ist dieser Eintrag zyklisch auszuf<75>hren.
|
||||
7
Logical/Machine/AIRConf/Simple.dob
Normal file
7
Logical/Machine/AIRConf/Simple.dob
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio FileVersion="4.9"?>
|
||||
<DataObject SubType="Simple" xmlns="http://br-automation.co.at/AS/DataObject">
|
||||
<Files>
|
||||
<File>DataObject.dat</File>
|
||||
</Files>
|
||||
</DataObject>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user