Mögliche Syntax im Gerät-Objekt
logi.CAD 3 unterstützt folgende Syntax für eine Gerät-Konfiguration:
Syntax
DEVICE deviceConfig TYPE PTK := platform-name; END_TYPE COMMUNICATION (* optional_begin *) VIA comm_node_1; (* optional_end *) TARGET comm_node_2; END_COMMUNICATION END_DEVICE COMMNODE comm_node_1 PARAMS := 'jsonstring'; END_COMMNODE COMMNODE comm_node_2 PARAMS := 'jsonstring'; END_COMMNODE
Der Inhalt der Gerät-Konfiguration ergibt sich aus diesen Abschnitten/Elementen:
Abschnitt/Element | Erläuterung |
---|---|
DEVICE name ... END_DEVICE | Deklaration einer Gerät-Konfiguration, wobei name ein →IEC-Bezeichner sein muss |
| Plattform für die Gerät-Konfiguration Am besten wählen Sie eine Plattform mit Hilfe der Inhaltshilfe aus der Liste der verfügbaren Plattformen aus. |
COMMUNICATION (* optional_begin *) VIA comm_node_1; (* optional_end *) TARGET comm_node_2; END_COMMUNICATION | Spezifikation für die Kommunikation mit dem Zielsystem, wobei die Details für das Zielsystem in den nachfolgenden, benannten Abschnitten
|
COMMNODE comm_node_x PARAMS := 'jsonstring'; END_COMMNODE | Details für die Kommunikation mit dem Zielsystem
|
Beispiel 1: Gerät-Konfiguration bei Kommunikation ohne Gateway
DEVICE deviceConfig1 TYPE PTK := SafeLibraryWindowsX86; END_TYPE COMMUNICATION TARGET plc; END_COMMUNICATION END_DEVICE COMMNODE plc PARAMS := '{"ipAddress": "127.0.0.1", "port": 1535}'; END_COMMNODE
Beispiel 2: Gerät-Konfiguration bei Kommunikation via Gateway
DEVICE deviceConfig2 TYPE PTK := SafeLibraryWindowsX86; END_TYPE COMMUNICATION VIA gateway1; TARGET plc1; END_COMMUNICATION END_DEVICE COMMNODE gateway1 PARAMS := '{"ipAddress": "127.0.0.1", "port": 1535}'; END_COMMNODE COMMNODE plc1 PARAMS := ' { "transport" : { "type": "websockets", "parameters" : { "ip": "127.0.0.1", "port": 8081 } }, "infrastructure" : { "programmer": "STARTLOCAL", "parameters" : "8081" } } '; END_COMMNODE