-> Hier kostenlos registrieren
Hallo zusammen,
Ich bin dabei eine IEC 60870-5-104 Schnittstellenverbindung aufzubauen. Diese soll Daten zwischen einem Beckhof Panel(CP6601) und einer IDS SPS(acos750) tauschen. Ich hab alles soweit eingerichtet, doch die Daten werden leider nicht ausgetauscht. Weis jemand woran dies liegt?
Hier mein Projekt:
Die IDS SPS ist Master, das Beckhoff Panel Save (TCPIP Server ist auf Beckhoffpanel installiert)
Es wird hier zunächst versucht nur einen Boolschen Wert vom Slave an den Master zu senden.
Die beiden SPS-Programme:
IDS-SPS:
Beckhoff SPS:
In AcosET (Hardwareparametrierung für Ids SPS) habe ich mir hierfür folgendes Informationsobjekt erstellt(der blau markierte Datenpunkt):
Wer kennt des Retsels Lösung? Vielendank schonmal für die Mühe
Ich bin dabei eine IEC 60870-5-104 Schnittstellenverbindung aufzubauen. Diese soll Daten zwischen einem Beckhof Panel(CP6601) und einer IDS SPS(acos750) tauschen. Ich hab alles soweit eingerichtet, doch die Daten werden leider nicht ausgetauscht. Weis jemand woran dies liegt?
Hier mein Projekt:
Die IDS SPS ist Master, das Beckhoff Panel Save (TCPIP Server ist auf Beckhoffpanel installiert)
Es wird hier zunächst versucht nur einen Boolschen Wert vom Slave an den Master zu senden.
Code:
für beide sind folgende Parameter eingestellt:
max. unquitierte ADPUs bei Übertragung (k) : 12
max. empfangene ADPUs bei Übertragung (w) : 8
Verbindungstimeout (t0): 30s
Quittierungstimeout (t1): 15s
Quittierungstimeout (t2): 10s
Verbindungstest Timeout (t3): 20s
Übertragungsursache (Cause of Transfer size): 2 octets
Geräteadressengröße (Common ASDU address size): 2 octets
Informationsobjektadressengröße (Information object adress size): 3 octets
Geräteadresse (Common ASDU adress): 7
auf Beckhoffseite ist des weiteren folgendes eingestellt (wofür ich auf IDS Seite keine Einstellmöglichkeit fand):
Originator address: 1
Max. APDU length: 253
Local port address: 2404
Local host adress: 192.168.253.97 (dies ist die eigene IP des Slave Bedienteils)
auf IDS-Seite ist des weiteren folgendes eingestellt:
IP des Slave(Zieladresse): 192.168.253.97
IDS-SPS:

Beckhoff SPS:
Code:
PROGRAM MAIN
VAR
AODB : ARRAY[0..1] OF ST_IEC870_5_101AODBEntry; (* Application object data base (only two data points) *)
hServer : T_HSERVER;(* server connection handle *)
server : FB_IEC870_5_104Slave; (* IEC 60870-5-104 slave function block instance *)
init : BOOL := TRUE;
SPI AT%MX0.0 : BOOL;(* Single point information (data point used in monitoring direction slave->master) *)
SCS AT%MX1.5 : BOOL;(* Single command state (data point used in control direction master->slave) *)
timer : TON := ( IN := TRUE, PT := t#1s );
END_VAR
IF init THEN
init := FALSE;
(* Create server handle *)
F_CreateServerHnd( '', (* own TwinCAT netID, empty string = local *)
'192.168.253.97', (* own (slave) IP address *)
2404,(* own (slave) port number *)
LISTEN_MODE_CLOSEALL OR CONNECT_MODE_ENABLEDBG, (* close all previous opened socket connections and enable debug output *)
TRUE,(* enable connection *)
hServer );
server.sysPara.asduAddr := 7; (* Configure common ASDU address *)
server.sysPara.dbgMode := IEC870_DEBUGMODE_DEVSTATE (*OR IEC870_DEBUGMODE_ASDU OR IEC870_DEBUGMODE_LINKLAYER*);(* enable output of device state change messages *)
(* Configure one single point in monitoring direction *)
F_iecInitAOEntry( M_SP_NA_1, (* type is single point *)
4161, (* information object address *)
IEC870_GRP_INROGEN, (* interrogation group *)
0,(* multiplier (not used) *)
MAP_AREA_MEMORY,(* map this single point value FROM PLC memory area (buffer) *)
0, (* map FROM byte offset *)
0, (* map FROM bit offset *)
AODB[0] );(* data base array element to initialize *)
(* Configure one single command in control direction *)
F_iecInitAOEntry( C_SC_NA_1, (* type is single command *)
24578,(* information object address *)
0, (* group (not used) *)
0, (* multiplier (not used) *)
MAP_AREA_MEMORY, (* map this single command value TO PLC memory area (buffer) *)
1, (* map TO byte offset *)
5, (* map TO bit offset *)
AODB[1] ); (* data base array element to initialize *)
ELSE
(* execute IEC slave function block *)
server( pInputs := 0, (* not used *)
cbInputs := 0, (* not used *)
pOutputs := 0, (* not used *)
cbOutputs := 0, (* not used *)
pMemory := ADR( %MB0 ),(* memory buffer where the data point values are mapped to and from *)
cbMemory := 2, (* 2 byte size *)
pData := 0, (* not used *)
cbData := 0, (* not used *)
pAOEntries := ADR( AODB ),
cbAOEntries := SIZEOF( AODB ),
hServer := hServer, (* server connection handle *)
bEnable := TRUE );
(* Check for device errors, remove them and log message to the TwinCAT System Manager log view *)
REPEAT
server.system.device.errors.RemoveError();
IF server.system.device.errors.bOk THEN
ADSLOGSTR( ADSLOG_MSGTYPE_ERROR OR ADSLOG_MSGTYPE_LOG, 'IEC60870-5-104 slave error: 0x%s',
DWORD_TO_HEXSTR( server.system.device.errors.getError.nErrId, 8, FALSE) );
END_IF
UNTIL NOT server.system.device.errors.bOk
END_REPEAT
END_IF
timer( IN := TRUE );
IF timer.Q THEN
timer( IN := FALSE );
SPI := NOT SPI;
END_IF

Wer kennt des Retsels Lösung? Vielendank schonmal für die Mühe
Zuletzt bearbeitet: