Quantcast
Channel: SPS-Forum - Automatisierung und Elektrotechnik
Viewing all 50556 articles
Browse latest View live

CoDeSys Zeitsteuerung

$
0
0
Hallo,

ich steuere über meinen Raspberry PI meine Wago IO Module über einen Profinetbus.

Ich würde gerne für meine Aussenbeleuchtung über eine Zeitsteuerung innerhalb des Wago IO Moduls die Aussenbeleuchtung steuern. Wie kann ich eine Zeitsteuerung realisieren?

CSV-Datei schließen in TwinCAT 2

$
0
0
Hi,

ich habe ein merkwürdiges Problem. Ich erstelle im Programm eine csv-Datei und schreibe in diese. Nach dem Schreiben wird die Datei geschlossen. Ich kann die csv-Datei nach dem Schließen aber nicht verschieben oder löschen, Windows sagt mir sie wäre in einem anderen Programm in Benutzung. Ist das ein bekanntes Problem?

Ich verwende folgenden Code (nur die CASES zum Schließen der csv-Datei):

CASE intState OF







5:
FBclose(bExecute:=FALSE);FBclose(sNetId:=,hFile:=File,
tTimeout:=T#5S,bExecute:=TRUE
);
intState:=6;


6:
FBclose( bExecute:=FALSE,bBusy=>Busy_FC,bError=>Error_FC,nErrId=>ErrID_FC);
IF NOT Error_FC THEN
IF NOT Busy_FC THEN
intState:=7;
END_IF
END_IF


7:
FBclose(bExecute:=FALSE);
dwStopt:=T_PLC_US();


END_CASE


Danke für jede Hilfe.


BC9100 in System-Manger einbinden

$
0
0
Hallo,

ich bin zu einer gebrauchten BC9100 gekommen und habe dazu eine Karte
digital INPUT und eine Karte digital OUTPUT. Ich habe mich eingelesen
und man sollte mit Hilfe eines PC´s und der BC9100 eine Steuerung zum
laufen bringen.
Ich habe Twincat 3

1x Sytemmangaer
1x PLC Controler

Ich habe die Schalter für die IP adresse laut unterlage gestellt

1= ON

alle anderen OFF


Nun versuche ich seit Stunden mit dem BC9100 zu kommunizieren -->keine
Chance
;(

Ich weiß nicht wie !!!!

Wenn ich auf Zielsystem klicke ist die Lokale Adresse der Wlan-Karte
hinterlegt ich benötige (glaub ich) die Adresse der Ethernet karte .

Dort habe ich auch die IP adresse 172.16.22.50/16 vergeben ---> laut
Anleitungen

Aber wenn ich das Netz scanne, kein Lebenszeichen.
Es ist so frustrierend.

Es wäre wirklich sehr nett wenn mir jemand Tipps geben könnte wie ich
die Sache richtig angehe. Einfach rum probieren ist leider nicht
Zielführend.

Noch etwas wenn ich mit dem IP scanner das netz scanne wo nur der BC9100 drauf hängt finde ich mehrere IP adressen.


DANKE :)
Angehängte Grafiken

Sonstiges S7 1212c dc dc dc

$
0
0
Hallo

bei meiner S7 1212C DC DC DC lassen sich die Eingänge irgendwie nicht ansteuern ( 24V an Eingang angelegt) nicht einmal im TIA Portal kann ich die Eingänge auf 1 steuren

schalter und regler

$
0
0
hallo

ich bin neu hier im forum und habe gleich eine frage

ich richte mir grade eine drehbank her die mit einem freqenzunrichter 230v 750w ausgestattet werden soll
nur möchte ich alles über seperate schalter und regler steuern und zwar einen schalter rechts/links lauf mit 0 stellung einen drehzahlregler und eine digialanzeige
alle 3 sachen sollte man an einen fu anschliesen können und es solte etwas zusammen passen vom aussehen

TIA VIPA FM054 Schrittmotor Modul als Gerät einbinden

$
0
0
Hallo und guten Abend,
ich suche gerade im Katalog unter VIPA GmbH das FM054 Modul. Keinen Eintrag.
Das neuste Paket (053-1PN00_V201) habe ich installiert.
Im Handbuch wird über die Projektierung kein Wort verloren.

Bin ziemlich ratlos. Hat jemand dieses Module schon einmal eingesetzt oder eine Idee?

Sytsemaufbau:
S71200 als Profinet Master
SLIO IM053 Slave mit meheren Modulen.

Gruß
Frank

Sonstiges Diris a40

$
0
0
Hallo,

wollte fragen, ob sich jemand mit diesem Multimessgerät auskennt, welches ich über Profibus an eine Beckhoff-SPS angeklemmt habe. Ich erhalte zwar irgendwelche Werte, jedoch kann ich damit nichts anfangen.
Irgendwo habe ich gelesen, dass die Daten einfach ankommen und man z.B bei der Frequenz eine Division mit 100 macht.
Hoffe ihr könnt mir weiterhelfen.

Gruß
Angehängte Grafiken
Angehängte Dateien

Step 7 Instanz-DB aufschalgen - Wozu ?

$
0
0
Hallo,

ich kenne die Befehle AUF DB[..] und AUF DI[..]. Das aufschlagen eines DBs und das anschließende hantieren mit des Inhalt ist mir geläufig und ich verstehe auch den Sinn. Warum kann man allerdings einen DB als I-DB öffnen ? Ich verstehe nicht wozu das gut sein soll einen Global-DB als Instanz-DB aufzuschlagen :confused: Und kann man nachdem man einen DB als I-DB aufgeschlagen hat noch symbolisch auf die Variablen des "echten" Instanz-DBs (sprich die Schnittstellen-Variablen) zugreifen ?

Suche Dokumentation zu alten Interbus-C- & Interbus-S-Komponenten

$
0
0
Hallo!

Vor ein paar Tagen sind mir ein paar Interbus-C-Module (IBC 24 ADIO 5) sowie PC-Karten (IBC PC CON) mitsamt Busleitung zugelaufen. Etwas Dokumentation zu dem IBC 24 ADIO 5 sowie der IBC PC CON sind auch dabei gewesen, mehr leider nicht. Wie ich den Unterlagen entnehmen kann, gab es im System Interbus-C (welches wohl auf dem BITBUS von Intel aufbaut) wohl diverse Module - und von Phoenix Contact wohl auch Treiber, um die PC-Karte sowie die angeschlossenen Bus-Teilnehmer ansprechen zu können. Die Programmierung lief dabei wohl über Hochsprachen-Umgebungen wie Microsofts QBASIC, Borlands Pascal u. A.. Leider habe ich diese Treiber nicht mit dazu bekommen, auch der "Interbus-C-Monitor" (IBCM) ist nicht dabei. Bei Phoenix Contact habe ich diesbezüglich zwar angefragt - wurde aber darauf hingewiesen, dass die Komponenten schon über 15 Jahre lang abgekündigt seien und dadurch keine Dokumentation oder Software mehr zur Verfügung gestellt werden könnte. Das ist verständlich - und dennoch finde ich es schade.

Weiterhin bin ich auch auf der Suche nach Unterlagen für die ganz alten Interbus-S-Komponenten der ersten Stunden. Zu diesen findet man auf der Phoenix-Webseite teilweise noch die Bestellnummern oder Bezeichnungen - aber leider fast keine Unterlagen mehr. Das älteste, was ich so finden konnte, sind Treiber-Programme für einige alte S5-Anschaltbaugruppen (IBS S5 DAB oder IBS S5 DCB), jedoch kaum Dokumentation zur Hardware selbst. Bei den Bus-Teilnehmern abseits der Anschaltbaugruppen scheint selbst schon die RT-Serie nicht mehr vollständig zu sein - ganz zu schweigen von alten I/O-Teilnehmern wie der IBS 24-Serie (wie IBS 24 AI/1, IBS 24 BK-I/O, IBS 24 BK-T, IBS BK-I/O-T, IBS 24 DI, IBS 24 DI/32, IBS 24 DO 1, IBS 24 DO/32 usw.), die z. T. noch nicht über die 9poligen Stecker verbunden wurden, sondern über 15- oder 25polige Steckverbinder verbunden wurden (wobei der 25polige wohl der Fernbus ist und der 15polige wohl ein Peripheriebus).

Hat für das System Interbus-C, die IBS 24-Serie, sowie für die alten S5-Anschaltungen (IBS S5 DAB, IBS S5 DCB, IBS S5/SL) noch Unterlagen in elektronischer Form da? Ich hätte auch die Möglichkeit, in Papier vorliegende Unterlagen einzuscannen, sofern diese nicht fest gebunden sind. Die Unterlagen, die ich für die IBC 24 ADIO 5 und IBC PC CON habe, werde ich auch einscannen.

Besten Dank!

Grüße, Xaar.

Mitsubishi FR-E740EC 30 Amp zweite Betriebsmeldung

$
0
0
Hallo,

wir haben einen FR-E740EC 30 Amp im Einsatz welcher im Rechts.- und Linkslauf betrieben wird. Serienmäßig hat er aber nur ein Relais für die Betriebsmeldung verfügbar. Ich bräuchte aber je eine separate für Rechts.- und Linkslauf. Kann man da nen Kontakt umprogrammieren? Störmeldung, Betrieb rechts und 2 Festdrehzahlen sind schon belegt.

Danke

Array index auslesen

$
0
0
Hallo zusammen

Momentan tüftle ich jeden Tag an der SPS rum, um in kurzer Zeit möglichst viel in Erfahrung zu bringen.

Zurzeit versuche ich einen besimmten Wert in einem Array zu finden.
Sobald ich diesen Array habe, benötige ich die indexnummer.

Zum Beispiel:

i_Produktenummer [1..50] Array of DInt;

i_Produktenummer [34] := 65983;

Mit einer Schleife durchsuche ich alle diese Nummern und vergleiche diese. Sobald ich die Nummer 65983 gefunden habe, benötige ich den index von dieser Zahl in meinem Fall die 34.
Wie ermittle ich diesen Index?

Die erfolglose Reparatur an meinem Siemens Herd ;-)

$
0
0
Warum passieren solche Sachen immer am Freitag?

Da hat man endlich ein freies Wochenende und dann so etwas. Ein Knall in der Küche. Ich höre meine bessere Hälfte nur noch schreien. Beim öffnen der Backofentür an unserem (5 Jährigen Siemens HE76AB560) Herd. Zitat „Hat einen Mega Knall gegeben.“
Kein Problem dachte ich, Birne Kaputt, machen wir mal kurz die Sicherung wieder rein. Fehldiagnose :eek: Display Tot !! Fakt war, die Birne ist aus der Fassung gefallen und hat sich wohl per Kurzschluss verabschiedet. Der Herd gab keinem Mucks mehr von sich. Also Werkzeugkiste rausgekramt und den Kerl ausgebaut und zerlegt. Ich hab nicht schlecht gestaunt. Auf der Hauptplatine 2 schwarze Flecken. Total Schrott.
20160904_155835.jpg

Mein erster Gedanke war: Kann man löten, die defekten Widerstände.
Aber das Spiel geht weiter. Ich hab gedacht das wäre ein Klacks. Weiter geforscht. Aha das Display stinkt so richtig schön. Dort hat sich wohl eine Diode verabschiedet. Meine Güte ;-(
20160904_162714.jpg
Ich habe mich dann sofort von der Thematik Eigenreparatur verabschiedet und mich dem Neukauf eines neuen zuzuwenden.

Frage an Euch wie kann es sein, dass eine (beschi….) Backofenbirne 2 Platinen im Herd so zerlegen kann ?

Erschwerend kommt noch dazu meine Induktionsplatten wurden über den Steuerteil meines explosiven Herds gesteuert.
Nun stellt sich folgende Frage.

Nachfolger kaufen oder Backofen und Induktion getrennt ?

Gruß vom Wälder (mit der kalten Küche)
Angehängte Grafiken

Hebevorrichtung

$
0
0
Hallo zusammen,
ich soll eine Hebevorrichtung umbauen.

Es sind zwei Kfz-Bühnen, mit zwei separaten Steuerungen, die gleichzeitig fahren sollen.

Beim Fahren und vor allem beim Tippen mit den Tastern kommt es zum ungleichen lauf der Motoren.
Es sind 4 Motoren, 4 Näherungssensoren, die die Spindelumdrehungen registrieren und 4 Näherungssensoren für die 0-Punte.
Mein Gedanke war die Umdrehungen, der einzelnen Spindeln miteinander zu vergleichen und dann dem entsprechend reagieren.
Es sind NPN Näherungssensoren deshalb musste ich Koppelrelais einsetzen um 24v Signal auf die Easy zu bekommen.
Die Spindel macht ca. 400 U/min. Ich habe normale Zähler der Easy 822 verwendet und da liegt mein Problem.
Da werden nicht alle Impulse der Sonden gezählt.
Danach habe ich mit Hochgeschwindikeitszählern versucht aber da gibt es Unterschiede zwischen den Zählern.

Woran kann es liegen? An den Näherungssensoren? An den Koppelrelais? Oder an der Easy?

  • :???:

Step 7 Vorschlag für Error-Handling mit WinCC-Fehlerauswertung/-anzeige & Einzelquitt.

$
0
0
Ich musste für einen Kunden das 'Fehlerhandling' vereinheitlichen und habe mir lange den Kopf darüber zerbrochen.
Entstanden sind drei Funktionen und zwei Excel-Tabellen, mit der man das Anlegen, Quittieren, Einzelquittieren,
In-und Exportiereren von Fehlermeldungen relativ komfortabel erledigen kann.

Schaut euch das 18minütige Video an.
War schon fast mehr Arbeit als wie das Ausdenken und Umsetzen des Codes :rolleyes:
1.png

2.png

3.png

Das Ergebnis ist sicherlich nicht der Weisheits letzter Schluss und ausbaufähig.
Es ist in AWL programmiert und ist mit Zeilenkommentaren versehen.
Vllt hilft es dem einen oder anderen. Wiederverwendung, Verbesserung ist explizit erwünscht.
Oder falls Jemand noch Anwendungsbeispiele 'Any, AR1, AR2, Loop, etc...' braucht - hier findet ihr alles :icon_mrgreen:

Da nicht alles auf dem 1.Blick ersichtlich ist, habe ich mir auch erlaubt Video zu erstellen.
Hier wird die Funktion, der Aufbau bishin zur Simulation mit PLCsim erklärt.


Ich hätte das Demo-Projekt hochgeladen. Allerdings verpfuscht Siemens alle möglichen
Stellen im Projekt mit personen-und firmenbezogenen Angaben.

Darum müssen AWL-Quellen und das Video ausreichen ;)

Hochgeladen habe ich das Packet bestehend aus drei AWL-Quellen, ExcelTabellen und ein Video
auf mega.nz... mir ist auf die schnelle kein besserer Filehoster eingefallen.
https://mega.nz/#F!xJcXARLT!YykSh7HUorCOcAbCYdIN9Q

Viel Spass. Feedback/Kritik ist erwünscht :)

Edit: Die exportierten AWL Quellen befinden sich auf dem Hoster.
Falls Jemand Hoster nicht mag, hier sind sie auch...

Code:

FUNCTION "1_MoveFaultsToHMI" : VoidTITLE = Verodere Ext. Quittierbits mit Fehlermeldungen und schiebe es zum HMI-Array
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
  VAR_INPUT
      iResPLC : Bool;  // Internal/Global reset request from PLC
      iResExt : Bool;  // Internal/Global reset request from external
      iFaults : Any;  // Pointer for the source of all faults
      iExtResets : Any;  // Pointer for the source of the external request requests
      qHMITrigArray : Any;  // Pointer for the destination HMI array, where the faults and the reset requests are stored
  END_VAR


  VAR_OUTPUT
      qResExt : Bool;  // Collective reset from external
      qfault : Bool;  // fault: target array is not large enough
  END_VAR


  VAR_TEMP
      hexFF : Byte;  // local 'constant' with B#16#FF
      hex00 : Byte;  // local 'constant' with B#16#00
      loop01 : Int;  // loop counter
      retval : Int;  // just return value, for some 'calls'
      tFaults : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tExtResets : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tHMITrigArray : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      WorkAnySource : Any;  // Any pointer for the 'source'
      WorkAnyTarget : Any;  // Any pointer for the 'destination'
      StartAdress2ndHalfTarget : DWord;  // adres-pointer for the 2nd half of the destination
  END_VAR




BEGIN
NETWORK
TITLE = Lokaldaten initialisieren
      L b#16#0;
      T #hex00;
      L b#16#ff;
      T #hexFF;
NETWORK
TITLE = Eingänge 'zerlegen' und in Lokaldaten kopieren
//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iFaults;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tFaults;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iExtResets;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tExtResets;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##qHMITrigArray;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tHMITrigArray;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################
NETWORK
TITLE = Prüfen ob das Zielfach ausreichen groß ist
//load source byte length and multiply by 2
//reason: in the target array, the first half are the triggers
//        the 2nd half will be the reset bits through the hmi
//        Hence, the destination array must have the double size
//        of the source.
//load source
      L #tFaults.repetition;
      L 2;
      *I;
//load destination
      L #tHMITrigArray.repetition;
//if the source is bigger than the destination = fault
      >I;
      = #qfault;
//if we have a fault, no further processment is required
//programming error
      BEC;
NETWORK
TITLE = Kopiere 1.Hälfte in Ziel-Array: Fehlermeldungen
//build a temporary anypointer for the SOURCE
      LAR1 P##WorkAnySource;
      L #tFaults."10h";
      T B[ AR1, P#0.0];
      L #tFaults.DataType;
      T B[ AR1, P#1.0];
      L #tFaults.repetition;
      T W[ AR1, P#2.0];
      L #tFaults.db_no;
      T W[ AR1, P#4.0];
      L #tFaults.adres;
      T D[ AR1, P#6.0];
//build a temporary anypointer for the DESTINATION
      LAR1 P##WorkAnyTarget;
      L #tHMITrigArray."10h";
      T B[ AR1, P#0.0];
      L #tHMITrigArray.DataType;
      T B[ AR1, P#1.0];
      L #tHMITrigArray.repetition;
      T W[ AR1, P#2.0];
      L #tHMITrigArray.db_no;
      T W[ AR1, P#4.0];
      L #tHMITrigArray.adres;
      T D[ AR1, P#6.0];


//just copy data now
      CALL BLKMOV
      {blk_type := 'Variant'}
      (  SRCBLK                      := #WorkAnySource ,
        RET_VAL                    := #retval ,
        DSTBLK                      := #WorkAnyTarget
      );
NETWORK
TITLE = Kopiere 2.Hälfte in Ziel-Array: Fehlermeldungen - bei Reset PLC oder EXT Zielbereich mit FF überschreiben
//build a temporary anypointer for the SOURCE
      LAR1 P##WorkAnySource;
      L #tExtResets."10h";
      T B[ AR1, P#0.0];
      L #tExtResets.DataType;
      T B[ AR1, P#1.0];
      L #tExtResets.repetition;
      T W[ AR1, P#2.0];
      L #tExtResets.db_no;
      T W[ AR1, P#4.0];
      L #tExtResets.adres;
      T D[ AR1, P#6.0];


//#################################################################
//before we build the DESTINATION Array,
//we must correct/adapt the start adress.
//as described in a previous network, the external
//reset requests has to be placed into the 2nd half of
//the target array.


//take the length (repition factor)
      L #tHMITrigArray.repetition;
//divide by 2 (=the half)
      L 2;
      /I;
//multiply by 8, to get the right format (bitwise adresing)
      SLD 3;
//start adres is calculated right now
//we should also take the memory area from the origin any pointer
      L #tHMITrigArray.adres;
//take only the lowest byte
//wordwise OR accu1 (memory area) with accu2 (calculated start adres)
      OD;
//save for later usage
      T #StartAdress2ndHalfTarget;
//#################################################################


//build a temporary anypointer for the DESTINATION
      LAR1 P##WorkAnyTarget;
      L #tHMITrigArray."10h";
      T B[ AR1, P#0.0];
      L #tHMITrigArray.DataType;
      T B[ AR1, P#1.0];
      L #tHMITrigArray.repetition;
      T W[ AR1, P#2.0];
      L #tHMITrigArray.db_no;
      T W[ AR1, P#4.0];
//take the previously calculated start adres for the 2nd half of
//destination array
      L #StartAdress2ndHalfTarget;
      T D[ AR1, P#6.0];


//just copy data now
      CALL BLKMOV
      {blk_type := 'Variant'}
      (  SRCBLK                      := #WorkAnySource ,
        RET_VAL                    := #retval ,
        DSTBLK                      := #WorkAnyTarget
      );


//#################################################################
//if there is PLC or External reset request fill the whole destination
//area with B#16#FF
//We are going to fill only the area, which is neccessary.
//This is the reason, why we are calculation the destination pointer again


      O #iResPLC;
      O #iResExt;
      JCN nofi;


//build a temporary anypointer for the DESTINATION
      LAR1 P##WorkAnyTarget;
      L #tHMITrigArray."10h";
      T B[ AR1, P#0.0];
      L #tHMITrigArray.DataType;
      T B[ AR1, P#1.0];
//instead of the length of the destination area (is longer than source)
//we will use the length of source...we make sure, that we are only
//filling/initialising the are, which is neccessary.
//      L    #tAnyHMITrigArray.repetition
      L #tExtResets.repetition;
      T W[ AR1, P#2.0];
      L #tHMITrigArray.db_no;
      T W[ AR1, P#4.0];
//take the previously calculated start adres for the 2nd half of
//destination array
      L #StartAdress2ndHalfTarget;
      T D[ AR1, P#6.0];


      CALL FILL
      {ptr_type := 'Variant'}
      (  BVAL                        := #hexFF ,
        RET_VAL                    := #retval ,
        BLK                        := #WorkAnyTarget
      );


nofi:      NOP 0;
NETWORK
TITLE = Prüfe ob irgendeine Reset-Anforderung von Extern anliegt und baue ein 'collective_reset' daraus
//initialise the local bool, for evaluating if any external reset is existent
      CLR;
      = #qResExt;


//here we are going to check, if there is any reset request existent from
//the external source... this will be done by a loop
//we are going to 'scan' the external requests requests bytewise


//as first, open the corresponding data block, where the information is stored
      OPN DB[ #tExtResets.db_no];


//load the adres pointer into AR1
      LAR1 #tExtResets.adres;
//the length (in bytes) of the source area, will be the counter for the
//loop, hence we're going to scan 'byte-wise'
      L #tExtResets.repetition;
lp01:      T #loop01;


//open the first byte, and check it 'not equal zero'
      A(;
      L B[ AR1, P#0.0];
      L #hex00;
      <>I;
      );
//if its something else than zero (no jump), set '#qResExt' to '1' and exit loop
//if its zero (jump), put an offset to the AR1 (next byte) and go to next loop scan
      JCN next;
      S #qResExt;
      JU olop;


next:      +AR1 P#1.0;
      L #loop01;
      LOOP lp01;


olop:      NOP 0;


//if there is a external global request, set as well the output to true
      A #iResExt;
      S #qResExt;


END_FUNCTION

Code:

FUNCTION "2_SplitHMIReset" : VoidTITLE = Einzelquittierung von der Visualisierung splitten und in ein Strukt kopieren
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
  VAR_INPUT
      iHmiResetArray : Any;  // Pointer of the source of all HMI reset requests (array of word)
      qHmiResetSplitted : Any;  // Pointer for the destination, where the requests will stored
      iHelpArray : Any;  // Pointer of the source with help flags (array of word)
      iEdgeEval : Bool;  // 1=with edge evaluation, 0=without edge evaluation
  END_VAR


  VAR_OUTPUT
      qHmiReset : Bool;  // collective reset request from HMI received
  END_VAR


  VAR_TEMP
      tiHmiResetArray : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tqHmiResetSplitted : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tiHelpArray : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tEdgeEval : Bool;  // 1=with edge evaluation, 0=without edge evaluation
      loop01 : Int;  // loop counter
      retval : Int;  // just return value, for some 'calls'
      repetition_in_word : Int;  // interim value, for the calculation of the loop counter
      result_word_loop : Word;  // interim value, for saving
  END_VAR




BEGIN
NETWORK
TITLE = Initialisation
      A #iEdgeEval;
      = #tEdgeEval;
NETWORK
TITLE = Eingänge 'zerlegen' und in Lokaldaten kopieren
//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iHmiResetArray;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tiHmiResetArray;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split DestinationAny into local data
//copy any pointer of source into AR1
      L P##qHmiResetSplitted;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tqHmiResetSplitted;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split DestinationAny into local data
//copy any pointer of source into AR1
      L P##iHelpArray;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tiHelpArray;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################
NETWORK
TITLE = Werte Einzelquittierung aus
//issue: the hmi is sending always '1' as acknowledgment for the corresponding
//fault, if there is no reset request neccessary.
//it's is not good style, to occupy the reset input of flip flop with a
//'1', if there is no reason for that.
//that is the reason, why we have to evaluate the rising edge (one shot) only.
//for that, unfortunately we need for each ack-bit a help bit.
//we are going to start a loop, whom the result will be stored in the local data
//after loop, the local data will be copied into the destination.


//open the source data block, where the acknowledgement bits are coming from
      OPN DB[ #tiHmiResetArray.db_no];
//load the start adres into AR1
      LAR1 #tiHmiResetArray.adres;


      L #tqHmiResetSplitted.repetition;
//divide by /2, hence we are going to scan wordwise
      L 2;
      /I;
      T #repetition_in_word;
lp01:      T #loop01;


//if EdgeEvaluation is not desired, jump directly to copying of data
//without evaluating of risingedge evaluation
      AN #tEdgeEval;
      JC noed;


//calculate coresponding adres for help words and open data instance
      L #tiHelpArray.adres;
//disable memory area format (usually b#16#84 (=DB) is located here
      AD DW#16#00ffffff;
//add '85' as memory area (=DI)
      OD dw#16#85000000;
//put the result into AR2
      LAR2;
//calculate offset for the adres
//1st run: e.g. (32-32)*2 = Offset = 0 bytes
//2nd run:  (32-31)*2 = 1*2= 2 bytes
//3rd run: (32-30)*2 = 6 bytes
//etc...
      L #repetition_in_word;
      L #loop01;
      -I;
      L 2                  ;//*2, hence we are scanning word-wise
      *I;
//bring to correct pointer format in bits = multiply by 8
      SLD 3;
//add the adres to AR2
      +AR2;
//opn data block in to DI register
      OPN DI[ #tiHelpArray.db_no];


//#############################################
//check for rising edge - wordwise
//check current values with help flags, if there is a difference
      L DBW[ AR1, P#0.0];
      L DIW[ AR2, P#0.0];
      INVI;
      AW;
//hence we have only two adres registers, we must save the value into
//local data, so that we can use it later
      T #result_word_loop;


//overwrite help flags with current values
      L DBW[ AR1, P#0.0];
      T DIW[ AR2, P#0.0];
      JU write;
//#############################################


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//this part will only be executed, if edge evaluation doesnt
//has been desired / not wished
noed:      L DBW[ AR1, P#0.0];
      T #result_word_loop;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


write:      NOP 0;
//calculate adres of target
//description, what we are doing here, is described few lines above
      L #tqHmiResetSplitted.adres;
      AD DW#16#00ffffff;
      OD dw#16#85000000;
      LAR2;
      L #repetition_in_word;
      L #loop01;
      -I;
      L 2                  ;//*2, hence we are scanning word-wise
      *I;
      SLD 3;
      +AR2;
      OPN DI[ #tqHmiResetSplitted.db_no];


//take the saved value from the local stack and put into the target
      L #result_word_loop;
      T DIW[ AR2, P#0.0];


//add offset of two for next scan into AR1
      +AR1 P#2.0;
      L #loop01;
      LOOP lp01;
NETWORK
TITLE = Globales Reset durch HMI - wurde irgendeine Einzelquittierung ausgeführt?
//initialise the local bool, for evaluating if any external reset is existent
      CLR;
      = #qHmiReset;


//here we are going to check, if there is any reset request existent from
//the HMI... this will be done by a loop
//we are going to 'scan' bytewise


//as first, open the corresponding data block, where the information is stored
      OPN DB[ #tqHmiResetSplitted.db_no];


//load the adres pointer into AR1
      LAR1 #tqHmiResetSplitted.adres;
//the length (in bytes) of the source area, will be the counter for the
//loop, hence we're going to scan 'byte-wise'
      L #tqHmiResetSplitted.repetition;
lp02:      T #loop01;


//open the first byte, and check it 'not equal zero'
      A(;
      L DBB[ AR1, P#0.0];
      L b#16#0;
      <>I;
      );
//if its something else than zero (no jump), set '#qResExt' to '1' and exit loop
//if its zero (jump), put an offset to the AR1 (next byte) and go to next loop scan
      JCN next;
      S #qHmiReset;
      JU olop;


next:      +AR1 P#1.0;
      L #loop01;
      LOOP lp02;


olop:      NOP 0;
END_FUNCTION

Code:

FUNCTION "3_CollectiveFault" : VoidTITLE = Prüfen auf Sammelfehler
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
//Dieses Baustein kann sechs Strukturen auf Sammelfehler überprüfen.
//Die Fehlerstrukturen müssen sich in einem globalen Datenbaustein (DB) befinden.
//Es dürfen nicht die Instanzdaten eines FB's ein (DI).
  VAR_INPUT
      iGroup_All : Any;  // Pointer of the source, where all faults are located
      iGroup1 : Any;  // Pointer of a source/group, where should be shown for a collective fault
      iGroup2 : Any;  // Pointer of a source/group, where should be shown for a collective fault
      iGroup3 : Any;  // Pointer of a source/group, where should be shown for a collective fault
      iGroup4 : Any;  // Pointer of a source/group, where should be shown for a collective fault
      iGroup5 : Any;  // Pointer of a source/group, where should be shown for a collective fault
  END_VAR


  VAR_OUTPUT
      qerror : Bool;  // Input parameters are wrong
      qFault_All : Bool;  // Collective Fault
      qFault1 : Bool;  // Collective fault in Group 01
      qFault2 : Bool;  // Collective fault in Group 02
      qFault3 : Bool;  // Collective fault in Group 03
      qFault4 : Bool;  // Collective fault in Group 04
      qFault5 : Bool;  // Collective fault in Group 05
  END_VAR


  VAR_TEMP
      tGroupAll : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tGroup1 : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tGroup2 : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tGroup3 : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tGroup4 : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tGroup5 : Struct  // splitted any pointer
        "10h" : Byte;
        DataType : Byte;
        repetition : Int;
        db_no : Int;
        adres : DWord;
      END_STRUCT;
      tloop : Int;
  END_VAR




BEGIN
NETWORK
TITLE = Initialisierung
      CLR;
      = #qerror;
      = #qFault_All;
      = #qFault1;
      = #qFault2;
      = #qFault3;
      = #qFault4;
      = #qFault5;
NETWORK
TITLE = Eingänge 'zerlegen' und in Lokaldaten kopieren
//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup_All;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroupAll;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup1;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroup1;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup2;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroup2;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup3;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroup3;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup4;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroup4;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################


//###Split SourceAny into local data
//copy any pointer of source into AR1
      L P##iGroup5;
      LAR1;
//copy any pointer of target into AR2
      LAR2 P##tGroup5;
//1st bytes is always 10h for s7
      L B[ AR1, P#0.0];
      T B[ AR2, P#0.0];
//copy data type
      L B[ AR1, P#1.0];
      T B[ AR2, P#1.0];
//copy repetition factor
      L W[ AR1, P#2.0];
      T W[ AR2, P#2.0];
//copy db number
      L W[ AR1, P#4.0];
      T W[ AR2, P#4.0];
//copy pointer (start adres)
      L D[ AR1, P#6.0];
      T D[ AR2, P#6.0];
//################################################
NETWORK
TITLE = Prüfe GroupAll nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroupAll.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroupAll.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en01;


//check for the correct memory area '84' = data block
      O(;
      L #tGroupAll.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err1;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroupAll.db_no];
      LAR1 #tGroupAll.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroupAll.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp01:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne01;
      S #qFault_All;
      JU en01;


ne01:      +AR1 P#2.0;
      L #tloop;
      LOOP lp01;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en01;


err1:      SET;
      S #qerror;


en01:      NOP 0;
NETWORK
TITLE = Prüfe Group1 nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroup1.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroup1.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en02;


//check for the correct memory area '84' = data block
      O(;
      L #tGroup1.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err2;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroup1.db_no];
      LAR1 #tGroup1.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroup1.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp02:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne02;
      S #qFault1;
      JU en02;


ne02:      +AR1 P#2.0;
      L #tloop;
      LOOP lp02;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en02;


err2:      SET;
      S #qerror;


en02:      NOP 0;
NETWORK
TITLE = Prüfe Group2 nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroup2.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroup2.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en03;


//check for the correct memory area '84' = data block
      O(;
      L #tGroup2.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err3;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroup2.db_no];
      LAR1 #tGroup2.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroup2.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp03:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne03;
      S #qFault2;
      JU en03;


ne03:      +AR1 P#2.0;
      L #tloop;
      LOOP lp03;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en03;


err3:      SET;
      S #qerror;


en03:      NOP 0;
NETWORK
TITLE = Prüfe Group3 nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroup3.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroup3.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en04;


//check for the correct memory area '84' = data block
      O(;
      L #tGroup3.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err4;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroup3.db_no];
      LAR1 #tGroup3.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroup3.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp04:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne04;
      S #qFault2;
      JU en04;


ne04:      +AR1 P#2.0;
      L #tloop;
      LOOP lp04;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en04;


err4:      SET;
      S #qerror;


en04:      NOP 0;
NETWORK
TITLE = Prüfe Group4 nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroup4.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroup4.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en05;


//check for the correct memory area '84' = data block
      O(;
      L #tGroup4.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err5;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroup4.db_no];
      LAR1 #tGroup4.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroup4.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp05:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne05;
      S #qFault2;
      JU en05;


ne05:      +AR1 P#2.0;
      L #tloop;
      LOOP lp05;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en05;


err5:      SET;
      S #qerror;


en05:      NOP 0;
NETWORK
TITLE = Prüfe Group5 nach einem Sammelfehler
//at first, we will check if the input any pointer contents meaningful
//data (db no, start adres, repetition factor)
//the pointer must contain a data block number
      O(;
      L #tGroup5.db_no;
      L 0;
      <=I;
      );


//the pointer must containt a length/repetition factor
      O(;
      L #tGroup5.repetition;
      L 0;
      <=I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC en06;


//check for the correct memory area '84' = data block
      O(;
      L #tGroup5.adres;
//for comparing only the first byte with memory area, we must 'disable'
//the start adress (the following three bytes)
      AD dw#16#ff000000;
      L dw#16#84000000;
      <>I;
      );
//if one this checks are positive jump and dont execute the rest of
//this network
      JC err6;


//########################################################################
//the structure will be scanned by a loop word-wise.
//if there is something equal than 'not zero' the corresponding
//flag will be set


//opn data block
      OPN DB[ #tGroup5.db_no];
      LAR1 #tGroup5.adres;
//&&&&&&&&&&&&&&& LOOP &&&&&&&&&&&&&&&&&&&&&&&&&
      L #tGroup5.repetition;
//divide thorugh to, hence we are going to scan wordwise
      L 2;
      /I;
lp06:      T #tloop;


//if its not zero, set fault and jump out of the loop
      L W[ AR1, P#0.0];
      L 0;
      <>I;
      JCN ne06;
      S #qFault2;
      JU en06;


ne06:      +AR1 P#2.0;
      L #tloop;
      LOOP lp06;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      JU en06;


err6:      SET;
      S #qerror;


en06:      NOP 0;
END_FUNCTION

Angehängte Grafiken

TIA Newbie: Verbindung zwischen S7-1200 und ET200SP projektieren

$
0
0
Hallo allerseits,

ich bin gerade dabei eine S7-1200 mit einer ET200SP zu projektieren, was ja von der Hardware kein Problem ist.
PN-Verbindung im TIA-Portal ist hergestellt und IP-Adressen sind zugewiesen.

Aber wie mache ich das im Programm um z.B. einen Eingang der dezentralen Peripherie und der lokalen CPU abzufragen um einen Ausgang der CPU zu schalten? Gibt es da irgendwelche nötigen Kommunikationsbausteine?
Hat vielleicht ein Mitleser einen hilfreichen Lektüre-Hinweis für mich?

Mfg,
Michael

Verbindungsproblem nach Stromausfall Controller-Koppler

$
0
0
Guten morgen zusammen,

ich babe ein Problem beim schalten vom Slave auf den Master nach einem Stromausfall.

Ich habe mit einem 750-880 als Master und einem 750-352 als Slave und mit einigen DI und DO ein einfaches Netz aufgebaut.
Über den Konfigurationsmanager der Codesys kann ich die notwendigen Codes und den Baustein erstellen.
Wenn ich mit dem Baustein nun die Ein- und Ausgänge verbinde und das ganze mit dem Bootprogramm auf den 880 lade und starte funktioniert alles wie gedacht. Master auf Slave und umgekehrt.

Wenn ich den Netzstecker von beiden ziehe und wieder stecke funktioniert nur das schalten vom Master auf den Slave aber nicht vom Slave auf sen Master.
Nur nachdem ich beispielsweise den Slave neu starte oder das Patchkabel kurz ziehe und wieder stecke.

Ich stehe zur Zeit auch mit dem Wago-Support direkt in Kontakt da das Thema ein Projekt bei einem Kunden betrifft und ich jeden Stromhalm greife den ich finden kann.

Das Problem sollte nicht dramatisch zu lösen sein, ich bin aber mit meinem Latein am Ende.

Könnt ihr mit dem Problem was anfangen und hättet ihr eine Lösung?

Viele Grüße, Wast

WinCC WinCC 7.4 / Basis Prozess Control

$
0
0
Hallo,

ich habe ein WinCC Projekt erstellt mit Basis Prozess Control Vorlage. Ich habe das Problem dass in der Runtime die Anwahl der Bilder nicht in der Reihefolge angezeigt werden, wie sie in der Hirachie des TreePictucemanager projektiert werden (siehe Scennshots). Hat jemand eine Idee woran das leigen kann.



TreePicture.jpg
Kopf.jpg

Danke vorab
Angehängte Grafiken

Step 7 Panel-Steuerung v. PG aus

$
0
0
Hallo Community,
ich bin an der Anlage und steuere über ein ‚MP177 6“ PN‘ und möchte es aus zeitlichen Gründen vermeiden um Ansteuerungstest durchzuführen ständig zum Panel gehen zu müssen. Von daher starte ich die Simulation am PC und mach das dann v. PG aus. Kann ich das eigentlich bedenkenlos tun?

Schöne Grüße

Sonstiges Logo!8 und 4-20 mA Input

$
0
0
Wer meint, dass die Logo!8 ohne weiteres einen 4-20mA Analog Input hätte, der täuscht sich. Im Gegensatz zu den "richtigen" SPS (S300) kann die Logo!8 nur 0-10V Analog-Inputs akzeptieren. Die im "Vertärker"-Baustein angebotenen 4-20mA sind nur eine Umrechunung des 10V Signals. Wer wirklich 4-20mA Inputs messen will, muss in Reihe zum zu messenden 4-20mA Sensor noch einen 500 Ohm Widerstand schalten, dessen Spannungsabfall dann die Logo!8 messen kann.
Also
Code:

+ 24V
    |
  |  |
  |  |  4-20mA
  |  |
    |
    |-------------------o 
    |
  |  |
  |  |  500 Ohm            0...10V Input Logo!8
  |  |
    |                  o                       
    |                 |

Step 7 Übungsprogramm mit S7 schreiben

$
0
0
Hallo ich bin absolouter Anfänger und noch voller offener Fragen :???:.
Mein Meister hat mir vor seinem Urlaub eine Aufgabe gestellt, als Übung sozusagen. Die Aufgabe lautet, ich habe eine SPS mit 8 Eingängen und 2 Ausgängen, diese ist über zwei Leitungen mit einer anderen SPS verbunden. Die andere SPS hat 2 Eingänge und 8 Ausgänge. Wenn ich ein oder mehrere Eingänge der ersten SPS setzte müssen die dem entsprechenden Ausgänge der zweiten SPS kommen. Ehm jaa, ist also bestimmt nichts wildes, wenn man es kann :icon_mrgreen: Wie könnte sowas aussehen und wie koppel ich die beiden SPS'en überhaupt miteinander?

Vielen Dank im vorraus :)
Viewing all 50556 articles
Browse latest View live
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>