IP-S7-Link .Net Advanced MATLAB is a toolbox which uses the software driver framework IP-S7-Link .Net Advanced which does implement the whole internet protocol (IP) stack for Simatic S7 controllers. While the toolbox does provide simple read / write methods it does also target different advanced scenarios. Using this toolbox does not only bring the possibility to bind programmable logic controller (PLC) addresses to your MATLAB application. It does also provide mechanisms to link variables or whole structs to one or more PLC addresses of your PLC device and read / write them at once. This section of the IP-S7-Link .Net Advanced MATLAB documentation provides information about basic application development tasks.
Name | Abkürzung (Siemens, DE) | Abkürzung(IEC) |
---|---|---|
Eingang | E | I |
Ausgang | A | Q |
Merker | M | M |
Peripherie | P | P |
Zähler | Z | C |
Datenbaustein | DB | DB |
Timer | T | 16 |
Name | Operant | Bits | Reichweite | Beschreibung | Array |
---|---|---|---|---|---|
BOOL | X | 1 | 0 bis 1 | Bit-Wert wahr (1) oder falsch (0) | x |
BYTE | B | 8 | 0 to 255 | Unsigned 8-Bit Ganzzahl | x |
WORD | W | 16 | 0 to 65.535 | Unsigned 16-Bit Ganzzahl (Word) | x |
DWORD | D | 32 | 0 to 232 -1 | Unsigned 32-bit Ganzzahl (Double Word) | x |
CHAR | B | 8 | A+00 to A+ff | Unsigned 8-Bit-Zeichen im ASCII-CODE | x |
INT | W | 16 | -32.768 to 32.767 | Signed 16-Bit-Ganzzahl | x |
DINT | D | 32 | -231 to 231-1 | Signed 32-Bit-Ganzzahl | x |
REAL | D | 32 | +-1.5e-45 to +-3.4e38 | IEEE754 32-bit single precision floating point Zahl | x |
S5TIME | W | 16 | 00.00:00:00.100 to 00.02:46:30.000 | binär codierte Dezimalzahl (BCD), die eine Zeitspanne repräsentiert | |
TIME | D | 32 | 00.00:00:00.000 to 24.20:31:23.647 | Signed 16-Bit-Ganzzahl, die eine Zeitspanne in Millisekunden darstellt | |
TIME_OF_DAY | D | 32 | 00.00:00:00.000 to 00.23:59:59.999 | unsigned 16-Bit-Ganzzahl, die eine Zeitspanne in Millisekunden darstellt | |
DATE | W | 16 | 01.01.1990 to 31.12.2168 | unsigned 16-Bit-Ganzzahl, die ein Datum in Tagen repräsentiert | |
DATE_AND_TIME | D | 64 | 00:00:00.000 01.01.1990 to 23:59:59.999 31.12.2089 | binär codierte Dezimalzahl (BCD), die ein Datum und eine Uhrzeit repräsentiert | |
S7String | B | beliebig | A+00 to A+ff | ASCII-Code, max. 254 Bytes |
Die Variablen setzen sich aus Operand und Datentyp zusammen. Beispiele:
Beispiele | Datentyp | Bsp. Siemens | Bsp. IEC |
---|---|---|---|
Eingang Byte 1, Bit 0 | BOOL | E 1.0 | I 1.0 |
Ausgang Byte 1, Bit 7 | BOOL | A 1.7 | Q 1.7 |
Merker Byte 10, Bit 1 | BOOL | M 10.1 | M 10.1 |
Datenbaustein 1, Byte 1, Bit 0 | BOOL | DB1.DBX 1.0 | DB1.DBX 1.0 |
Eingang Byte 1 | BYTE | EB 1 | IB 1 |
Ausgang Byte 10 | BYTE | AB 10 | QB 10 |
Merker Byte 100 | BYTE | MB 100 | MB 100 |
Peripherie Eingang Byte 0 | BYTE | PEB 0 | PIB 0 |
Peripherie Ausgang Byte 1 | BYTE | PAB 1 | PQB 1 |
Datenbaustein 1, Byte 1 | BYTE | DB1.DBB 1 | DB1.DBB 1 |
Datenbaustein 1, Datenbaustein Typ bool, Adresse 1.0 → DB1.DBX 1.0
Datenbaustein 1, Datenbaustein Typ Byte, Adresse 1 → DB1.DBB 1
Peripherie Eingang, Typ DWORD, Adresse 0 → PED 0
Merkhilfe:
DB#.DBB # = Datenbaustein#.Datenbaustein Byte #
DB#.DBW # = Datenbaustein#.Datenbaustein Wort #
DB#.DBD # = Datenbaustein#.Datenbaustein Doppelwort #
# = Adresse