Backup IBN Stand

This commit is contained in:
2022-08-11 16:55:24 +02:00
parent fc225e9335
commit c1a79a7a26
14 changed files with 221 additions and 37 deletions

View File

@@ -14,5 +14,6 @@
<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>
<Object Type="Library" Language="binary" Description="The AsString Library contains FBKs for memory and character string handling.">asstring</Object>
</Objects>
</Package>

View File

@@ -0,0 +1,33 @@
/* Automation Studio Generated Header File, Format Version 1.00 */
/* do not change */
#ifndef ASSTRING_H_
#define ASSTRING_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <bur/plc.h>
/* Constants */
/* Datatypes */
/* Datatypes of function blocks */
/* Prototyping of functions and function blocks */
unsigned short ftoa(float value, unsigned long pString);
unsigned short itoa(signed long value, unsigned long pString);
float atof(unsigned long pString);
signed long atoi(unsigned long pString);
#ifdef __cplusplus
};
#endif
#endif /* ASSTRING_H_ */

View File

@@ -0,0 +1,28 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASSTRING_
#define _ASSTRING_
#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 ftoa(float value, unsigned long pString);
_BUR_PUBLIC float atof(unsigned long pString);
_BUR_PUBLIC unsigned short itoa(signed long value, unsigned long pString);
_BUR_PUBLIC signed long atoi(unsigned long pString);
#ifdef __cplusplus
};
#endif
#endif /* _ASSTRING_ */

View File

@@ -0,0 +1,33 @@
/* Automation Studio Generated Header File, Format Version 1.00 */
/* do not change */
#ifndef ASSTRING_H_
#define ASSTRING_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <bur/plc.h>
/* Constants */
/* Datatypes */
/* Datatypes of function blocks */
/* Prototyping of functions and function blocks */
unsigned short ftoa(float value, unsigned long pString);
unsigned short itoa(signed long value, unsigned long pString);
float atof(unsigned long pString);
signed long atoi(unsigned long pString);
#ifdef __cplusplus
};
#endif
#endif /* ASSTRING_H_ */

View File

@@ -0,0 +1,74 @@
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ftoa : 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 atof : 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 itoa : 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 atoi : 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 memset : 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 memcpy : 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 memmove : 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 memcmp : 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 strcat : 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 strlen : UINT (*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 strcpy : 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 strcmp : DINT (*compares two character strings*)
VAR_INPUT
pString1 :UDINT; (*pointer to the first character string*)
pString2 :UDINT; (*pointer to the second character string*)
END_VAR
END_FUNCTION

View File

@@ -0,0 +1,4 @@
TYPE
END_TYPE

View File

@@ -0,0 +1,4 @@
VAR CONSTANT
END_VAR

View File

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

View File

@@ -5,7 +5,7 @@ TYPE
bSendAirNok : BOOL;
bSendAirOk : BOOL;
bSendAirOkAck : BOOL;
sLogfileName : BOOL;
sLogfileName : STRING[80];
END_STRUCT;
gtyp_VCButton : STRUCT (*VC - Button*)
usStatus : USINT; (*Anzeige / Bedienstatus*)

View File

@@ -1,11 +1,13 @@
PROGRAM _INIT
//SmptData
SmtpData.sSmtpServer := 'smtp.pliessnig.at';
SmtpData.sUser := 'sauberraum';
SmtpData.sPassword := 'sauberraum';
SmtpData.sSendername := 'pld.pliessnig.at';
//SmptData smtp-relay.sendinblue.com
SmtpData.sSmtpServer := '185.107.232.248';//'52.98.175.2'; //'smtp.office365.com';
SmtpData.sUser := 'mr@kerschdorfer-maschinenbau.de';
SmtpData.sPassword := '8yt32gs1khBTPI0D';
SmtpData.sSendername := 'pliessnig@kerschdorfer-maschinenbau.de';
SmtpData.Attachment.pData := ADR (SmtpData.sFilename);
//Modbus Kommunikation
FUBs.SmtpsSend.pHost := ADR (SmtpData.sSmtpServer);
@@ -17,15 +19,13 @@ PROGRAM _INIT
FUBs.SmtpsSend.pText := ADR (SmtpData.sText);
FUBs.SmtpsSend.pDomain := 0;
Status.enAirCom := enAIR_INIT;
END_PROGRAM
PROGRAM _CYCLIC
IF NOT FUBs.SmtpsSend.enable THEN
IF gMailCmd.bSendAirNok THEN
SmtpData.sRecipients := 'mr@kerschdorfer-maschinenbau.de,m.pliessnig@pliessnig.at';
SmtpData.sRecipients := 'm.pliessnig@pliessnig.at,louispliessnig@gmx.de,a.hoertnagl@pliessnig.at';
SmtpData.sSupject := 'Sauberraum Luft nicht OK (Produktion gestoppt)';
SmtpData.sText := 'Max. Anzahl Partikel in Luft wurde ueberschritten';
FUBs.SmtpsSend.attcnt := 0;
@@ -33,7 +33,7 @@ PROGRAM _CYCLIC
FUBs.SmtpsSend.enable := TRUE;
gMailCmd.bSendAirNok := FALSE;
ELSIF gMailCmd.bSendAirOk THEN
SmtpData.sRecipients := 'mr@kerschdorfer-maschinenbau.de,m.pliessnig@pliessnig.at';
SmtpData.sRecipients := 'm.pliessnig@pliessnig.at,louispliessnig@gmx.de,a.hoertnagl@pliessnig.at';
SmtpData.sSupject := 'Sauberraum Luft OK (Produktion gestoppt)';
SmtpData.sText := 'Max Anzahl Partikel in Luft wurde wieder unterschritten';
FUBs.SmtpsSend.attcnt := 0;
@@ -41,35 +41,37 @@ PROGRAM _CYCLIC
FUBs.SmtpsSend.enable := TRUE;
gMailCmd.bSendAirOk := FALSE;
ELSIF gMailCmd.bSendAirOkAck THEN
SmtpData.sRecipients := 'mr@kerschdorfer-maschinenbau.de,m.pliessnig@pliessnig.at';
SmtpData.sRecipients := 'm.pliessnig@pliessnig.at,louispliessnig@gmx.de,a.hoertnagl@pliessnig.at';
SmtpData.sSupject := 'Sauberraum Luft OK - Quittiert (Produktion freigegeben)';
SmtpData.sText := 'Fehler wurde quittiert';
FUBs.SmtpsSend.attcnt := 0;
FUBs.SmtpsSend.pAttachment := 0;
FUBs.SmtpsSend.enable := TRUE;
gMailCmd.bSendAirOkAck := FALSE;
ELSIF gMailCmd.bSendAirOkAck THEN
SmtpData.sRecipients := 'mr@kerschdorfer-maschinenbau.de,m.pliessnig@pliessnig.at';
SmtpData.sSupject := 'Sauberraum Luft OK - Quittiert (Produktion freigegeben)';
SmtpData.sText := 'Fehler wurde quittiert';
ELSIF gMailCmd.bSendLogfile THEN
SmtpData.sRecipients := 'm.pliessnig@pliessnig.at,louispliessnig@gmx.de,a.hoertnagl@pliessnig.at';
SmtpData.sSupject := 'Protokoll';
SmtpData.sText := 'Protokollierte Luftdaten';
SmtpData.Attachment.type := smtpATT_TYPE_FILE;
SmtpData.sFilename := 'F:/';
SmtpData.sFilename := 'DATALOG:/';
brsstrcat (ADR (SmtpData.sFilename), ADR (gMailCmd.sLogfileName));
FUBs.SmtpsSend.attcnt := ADR (SmtpData.Attachment);
FUBs.SmtpsSend.pAttachment := 1;
FUBs.SmtpsSend.pAttachment := ADR (SmtpData.Attachment);
FUBs.SmtpsSend.attcnt := 1;
FUBs.SmtpsSend.enable := TRUE;
gMailCmd.bSendAirOkAck := FALSE;
ELSIF
gMailCmd.bSendLogfile := FALSE;
END_IF
END_IF
//===================================
//Fubs ausf<EFBFBD>hren
//Fubs ausf<EFBFBD>hren
FUBs.SmtpsSend ();
IF (FUBs.SmtpsSend.status = ERR_OK) THEN
//Senden Ok
FUBs.SmtpsSend.enable := TRUE;
FUBs.SmtpsSend.enable := FALSE;
ELSIF (FUBs.SmtpsSend.status < ERR_FUB_BUSY) THEN
//Fehler
FUBs.SmtpsSend.enable := FALSE;
END_IF
END_PROGRAM

View File

@@ -1,19 +1,15 @@
TYPE
typ_Status : STRUCT (*Status*)
enAirCom : typ_enAirComm;
bAirNOk : BOOL; (*Luft nicht Ok*)
END_STRUCT;
typ_FUBs : STRUCT (*Funktionsbl<62>cke*)
SmtpsSend : SmtpsSend; (*Mail senden*)
END_STRUCT;
typ_StmpData : STRUCT
sSmtpServer : STRING[25]; (*Host*)
sUser : STRING[25];
sUser : STRING[80];
sPassword : STRING[25];
sSendername : STRING[25];
sRecipients : STRING[200];
sSupject : STRING[50];
sSendername : STRING[80];
sRecipients : STRING[300];
sSupject : STRING[80];
sText : STRING[200];
sFilename : STRING[50];
Attachment : smtpATTACHMENT_typ;

View File

@@ -1,5 +1,4 @@
VAR
Status : typ_Status; (*Status*)
SmtpData : typ_StmpData;
FUBs : typ_FUBs;
END_VAR

View File

@@ -59,9 +59,8 @@
<Group ID="FileDevice1" />
<Parameter ID="FileDeviceName1" Value="DATALOG" />
<Parameter ID="FileDevicePath1" Value="F:" />
<Group ID="FileDevice2" />
<Parameter ID="FileDeviceName2" Value="USER" />
<Parameter ID="FileDevicePath2" Value="USER_PATH" />
<Parameter ID="TimeZone" Value="140" />
<Parameter ID="ActivateDaylightSavingTime" Value="1" />
<Parameter ID="ActivateSntp" Value="1" />
<Parameter ID="SntpcServAddr1" Value="192.168.0.254" />
<Parameter ID="SntpcServAddr2" Value="172.20.1.201" />

View File

@@ -13,6 +13,7 @@
<TaskClass Name="Cyclic#7" />
<TaskClass Name="Cyclic#8">
<Task Name="ProcLog" Source="Common.ProcLog.prg" Memory="UserROM" Language="IEC" Debugging="true" />
<Task Name="SendMail" Source="Machine.SendMail.prg" Memory="UserROM" Language="IEC" Debugging="true" />
</TaskClass>
<DataObjects>
<DataObject Name="AIRConf" Source="Machine.AIRConf.dob" Memory="UserROM" Description="Modbusdaten" Language="Simple" />
@@ -64,12 +65,13 @@
<LibraryObject Name="dvframe" Source="Libraries.dvframe.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="DataObj" Source="Libraries.DataObj.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="standard" Source="Libraries.standard.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="astime" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="asieccon" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="vcresman" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="AsBrStr" Source="Libraries.AsBrStr.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="FileIO" Source="Libraries.FileIO.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="AsUSB" Source="Libraries.AsUSB.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="AsSMTP" Source="Libraries.AsSMTP.lby" Memory="UserROM" Language="binary" Debugging="true" />
<LibraryObject Name="astime" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="asieccon" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="vcresman" Source="" Memory="UserROM" Language="Binary" Debugging="true" />
<LibraryObject Name="asstring" Source="Libraries.asstring.lby" Memory="UserROM" Language="binary" Debugging="true" />
</Libraries>
</SwConfiguration>