-> Hier kostenlos registrieren
Hallo! Ich möchte die SNMP deaktivieren auf der CPU 317F-2PN/DP.
Ich befolge das vollständige Verfahren Schritt für Schritt anhand des unten aufgeführten Produktinformationsblatts.
Aber es wirft zurück Übersetzungsfehler, auch wenn es nur in den Quellen liegt und aufgrund dessen bin ich nicht in der Lage zu importieren/erzeugen Blöcke aus der Quelle.
Besonders wichtig ist, dass bei der Erstellung des Datenblocks "SNMP deaktivieren" die Variable snmp_record.Version/ snmp_record. "Version" nicht zur Verfügung steht.
Code:
DATA_BLOCK "WRREC_DB_1"
{InstructionName := 'WRREC';
LibVersion := '1.1';
S7_Optimized_Access := 'FALSE' }
AUTHOR : SIMATIC
FAMILY : DP
NAME : WRREC
VERSION : 1.0
WRREC
BEGIN
END_DATA_BLOCK
DATA_BLOCK "Deactivate SNMP"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
STRUCT
snmp_deactivate : BOOL;
snmp_record : STRUCT
BlockID : WORD;
BlockLenght : WORD;
"Version" : BYTE;
Subversion : BYTE;
Reserved : WORD;
SNMP_control : DWORD;
END_STRUCT;
snmp_done : BOOL;
snmp_error : BOOL;
snmp_status : DWORD;
END_STRUCT;
BEGIN
snmp_record.BlockID := 16#F003;
snmp_record.BlockLenght := 16#0008;
snmp_record."Version" := 16#0001;
END_DATA_BLOCK
ORGANIZATION_BLOCK "COMPLETE RESTART"
TITLE = "Complete Restart"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
VAR_TEMP
OB100_EV_CLASS : Byte; // 16#13, Event class 1
OB100_STRTUP : Byte; // 16#81/82/83/84 Method of startup
OB100_PRIORITY : Byte; // Priority of OB Execution
OB100_OB_NUMBR : Byte; // 100 (Organization block 100, OB100)
OB100_RESERVED_1 : Byte; // Reserved for system
OB100_RESERVED_2 : Byte; // Reserved for system
OB100_STOP : Word; // Event that caused CPU to stop (16#4xxx)
OB100_STRT_INFO : DWord; // Information on how system started
OB100_DATE_TIME : Date_And_Time; // Date and time OB100 started
END_VAR
BEGIN
"Deactivate SNMP".snmp_deactivate := 1; //Set WRREC Request
"Deactivate SNMP".snmp_record.SNMP_control := 16#0; //act=1 ; deact= 0
REPEAT
//Write data record
"WRREC_DB_1"(REQ := "Deactivate SNMP".snmp_deactivate,//Transfer data record
ID := 2046,//integrated profinet interface
INDEX := -20367,//Data record number for snmp deactivation
LEN := 12,
DONE => "Deactivate SNMP".snmp_done,
ERROR => "Deactivate SNMP".snmp_error,
STATUS => "Deactivate SNMP".snmp_status,
RECORD := "Deactivate SNMP".snmp_record);//Data record
UNTIL "Deactivate SNMP".snmp_done OR "Deactivate SNMP".snmp_error
END_REPEAT;
END_ORGANIZATION_BLOCK
Fehler:
Ich befolge das vollständige Verfahren Schritt für Schritt anhand des unten aufgeführten Produktinformationsblatts.
Aber es wirft zurück Übersetzungsfehler, auch wenn es nur in den Quellen liegt und aufgrund dessen bin ich nicht in der Lage zu importieren/erzeugen Blöcke aus der Quelle.
Besonders wichtig ist, dass bei der Erstellung des Datenblocks "SNMP deaktivieren" die Variable snmp_record.Version/ snmp_record. "Version" nicht zur Verfügung steht.
Code:
DATA_BLOCK "WRREC_DB_1"
{InstructionName := 'WRREC';
LibVersion := '1.1';
S7_Optimized_Access := 'FALSE' }
AUTHOR : SIMATIC
FAMILY : DP
NAME : WRREC
VERSION : 1.0
WRREC
BEGIN
END_DATA_BLOCK
DATA_BLOCK "Deactivate SNMP"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
STRUCT
snmp_deactivate : BOOL;
snmp_record : STRUCT
BlockID : WORD;
BlockLenght : WORD;
"Version" : BYTE;
Subversion : BYTE;
Reserved : WORD;
SNMP_control : DWORD;
END_STRUCT;
snmp_done : BOOL;
snmp_error : BOOL;
snmp_status : DWORD;
END_STRUCT;
BEGIN
snmp_record.BlockID := 16#F003;
snmp_record.BlockLenght := 16#0008;
snmp_record."Version" := 16#0001;
END_DATA_BLOCK
ORGANIZATION_BLOCK "COMPLETE RESTART"
TITLE = "Complete Restart"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
VAR_TEMP
OB100_EV_CLASS : Byte; // 16#13, Event class 1
OB100_STRTUP : Byte; // 16#81/82/83/84 Method of startup
OB100_PRIORITY : Byte; // Priority of OB Execution
OB100_OB_NUMBR : Byte; // 100 (Organization block 100, OB100)
OB100_RESERVED_1 : Byte; // Reserved for system
OB100_RESERVED_2 : Byte; // Reserved for system
OB100_STOP : Word; // Event that caused CPU to stop (16#4xxx)
OB100_STRT_INFO : DWord; // Information on how system started
OB100_DATE_TIME : Date_And_Time; // Date and time OB100 started
END_VAR
BEGIN
"Deactivate SNMP".snmp_deactivate := 1; //Set WRREC Request
"Deactivate SNMP".snmp_record.SNMP_control := 16#0; //act=1 ; deact= 0
REPEAT
//Write data record
"WRREC_DB_1"(REQ := "Deactivate SNMP".snmp_deactivate,//Transfer data record
ID := 2046,//integrated profinet interface
INDEX := -20367,//Data record number for snmp deactivation
LEN := 12,
DONE => "Deactivate SNMP".snmp_done,
ERROR => "Deactivate SNMP".snmp_error,
STATUS => "Deactivate SNMP".snmp_status,
RECORD := "Deactivate SNMP".snmp_record);//Data record
UNTIL "Deactivate SNMP".snmp_done OR "Deactivate SNMP".snmp_error
END_REPEAT;
END_ORGANIZATION_BLOCK
Fehler: