Scalance Modul diagnose (s7-1500, TIA-portal)
Siemens has released its own diagnosis library for Scalances (109753067_PNDateRecord_LIB_TIA_V21). It works very well, its show the used ports and it can read the IP, MAC address. If – on the other hand – the module shuts down (fails, loses power), the library will it not notify, as far as I know. I have fixed this problem with the program below. It can query any number of Scalance modules and gives only one bit of information about them: faulty or working. This information is usually sufficient for HMIs or SCADAs. In addition, the program reads the status of the ports from the units.
Note: I only had one Scalance module available for testing, so I entered the same HW_ID (260) 3 times and one wrong HW_ID (255) once in the sample program (see image below). The number of Scalances in the program can be set with the constant „maxScalNr”. HW_IDs must be specified in the “scalanceHwIds” array after specifying the constant.
Siemens hat eine eigene Diagnosebibliothek für Scalances veröffentlicht (109753067_PNDateRecord_LIB_TIA_V21). Dies funktioniert sehr gut, es liest die verwendeten Ports aus und es kann die IP- und MAC-Adresse lesen. Wenn andererseits das Modul heruntergefahren wird (ausfällt, Strom verliert), benachrichtigt die Bibliothek meines Wissens nicht. Ich habe dieses Problem mit dem folgenden Programm behoben. Es kann eine beliebige Anzahl von Scalance-Modulen abfragen und gibt nur eine Information darüber: fehlerhaft oder funktionsfähig. Diese Informationen sind normalerweise für HMIs oder SCADAs ausreichend. Zusätzlich liest das Programm den Status der Ports von den Einheiten.
Hinweis: Ich hatte nur ein Scalance-Modul zum Testen zur Verfügung, daher habe ich dreimal dieselbe HW_ID (260) und einmal eine falsche HW_ID (255) im Beispielprogramm eingegeben (siehe Abbildung unten). Die Anzahl der Scalances im Programm kann mit der Konstanten „maxScalNr” eingestellt werden. HW_IDs müssen nach Angabe der Konstante im Array „scalanceHwIds” angegeben werden.
A Siemens a Scalancekhez kiadott egy saját diagnózis könyvtárat (109753067_PNDateRecord_LIB_TIA_V21). Ez nagyon jól működik, kiadja a használt portokat és kiolvasható belőle az IP, MAC cím. Amennyiben viszont a modul lekapcsolódik (meghibásodik, megszűnik az áramellátása), arról a könyvtár – ismereteim szerint -nem értesít. Ezt a problémát küszöböltem ki az alábbi programmal. Ez tetszőleges számú Scalance modult tud lekérdezni, és csak egy bit információt ad róluk: hibás vagy működik. Ez az információ általában elég a HMI-k vagy SCADA-k felé. Ezen kívül a program beolvassa a portok státuszát az egységekről.
Megjegyzés: A teszteléeshez csak egy Scalance modul állt rendelkezésemre, ezért 3-szor ugyanazt a HW_ID-t (260) és egyszer egy rossz HW_ID-t (255) adtam meg a példaprogramban (lásd a lenti képen). A Scalance-k száma a programban a „maxScalNr” konstanssal állítható. A HW_ID-ket a „scalanceHwIds” tömbben kell megadni, a konstans megadását követően.
SCL-Programm download : diagScalances.scl
Siemens Library (and documentation) download: https://support.industry.siemens.com/cs/document/109753067/bibliothek-f%C3%BCr-profinet-datens%C3%A4tze?dti=0&lc=de-WW
Der Quellcode enthält einen scl-Code (dieser kann auch unten angezeigt werden). Der Code kann im TIA-Portal (16.0) geöffnet und kompiliert werden. Ich habe den Code mit einer Simatic S7-1513 und einer Scalance XC206-2 getestet.
The source code contains a scl code (this can also be viewed below). The code can be opened and compiled on the TIA portal (16.0). I tested the code with a Simatic S7-1513 and a Scalance XC206-2.
A forráskód egy scl-kódot tartalmaz (ez lent is megtekinthető). A kód a TIA portálon (16.0) nyitható és fordítható. A kódot egy Simatic S7-1513-mal és egy Scalance XC206-2-vel teszteltem.
From file (from 2020.10.30) downloads.
Donate
P.S.
If you have any further questions or have any issues that you can't handle, please contact me! » Impressum
~~socialite~~
Other codes
Themen:
- Simatic S7 SCL reference
- Simatic datatypes
- S7 error- and statuscodes
- TIA Portal know-how
Communication:
- S7-1500 - IntesisBox Modbus
- S7-1500 - Arduino Modbus
Diagnose:
- Scalance Modul diagnose
Partial solutions:
- INIT only one times w. delay
- DT to words and bytes
Conversions:
- Data types
- 16 BOOL → WORD/BYTE
- WORD → 16 BOOL
- BYTE → 8 BOOL
- STRING → DB REGS
- DB REGS → STRING
- REAL → WORD
- WORD → REAL
- DT → WORD/BYTE
- DT → STRING
- STRING → REAL/LINT