Modbus TCP PN CPU

K-SYSTEM-D

Level-1
Beiträge
51
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo Leute,

ich arbeite gerade an einem Modbus TCP Baustein, mein aktueller Master ist dabei eine Wago 750-881 falls das wichtig ist.

Die Verbindung ist kein Problem nur die Antwort ist mir rätzelhaft.

Hier die Antwort (aus der Hilfe rauskopiert)

[FONT=TimesNewRoman,Bold]
Aufbau der Exception
Byte Feldname Beispiel​
[/FONT]
.....
Byte 7 MODBUS function code 0x81​
Byte 8 Exception code 0x01 oder 0x02

Was bedeutet jetzt die Anwort?

Versteht der Master meine Anfrage nicht oder darf ich in diesem Bereich nicht lesen ?

Aktuell verwende ich die Funktion 1 (Bits lesen)

Byte 0 Transaction identifier B#16#0
Byte 1 Transaction identifier B#16#0
Byte 2 protocol identifier B#16#0
Byte 3 protocol identifier B#16#0
Byte 4 length field B#16#0
Byte 5 length field B#16#6
Byte 6 unit identifier B#16#1
Byte 7 MODBUS function code B#16#1
Byte 8 reference number B#16#0
Byte 9 reference number B#16#30​
Byte 10 Bit count B#16#8
Byte 11 Bit count B#16#0

gesendet werden diese 11 Byte und sollte wenn ich nicht falsch liege
der erste Merkerbereich in der Wago (MB0)

Die recerence number bezieht sich auf den NOVRAM Adressbereich
0x3000​


Ich wäre dankbar für jede Antwort.

MFG

Daniel
 
Hallo Daniel,
Exception 1 bedeutet, dass der Koppelpartner die Funktion nicht unterstützt - also den Funktionscode nicht kann.
Exception 2 bedeutet, dass auf eine nicht vorhandene/zulässige Adresse zugegriffen wird.

Gruß Kaulquappe
 
du findest das hier
http://www.modbus.org/specs.php


MODBUS Application Protocol Specification V1.1b Modbus-IDA
December 28, 2006​
http://www.Modbus-IDA.org 49/51

MODBUS Exception Codes
Code Name Meaning
01​
ILLEGAL FUNCTION The function code received in the query is not an
allowable action for the server (or slave). This
may be because the function code is only
applicable to newer devices, and was not
implemented in the unit selected. It could also
indicate that the server (or slave) is in the wrong
state to process a request of this type, for
example because it is unconfigured and is being
asked to return register values.

02​
ILLEGAL DATA ADDRESS The data address received in the query is not an
allowable address for the server (or slave). More
specifically, the combination of reference number
and transfer length is invalid. For a controller with
100 registers, the PDU addresses the first
register as 0, and the last one as 99. If a request
is submitted with a starting register address of 96
and a quantity of registers of 4, then this request
will successfully operate (address-wise at least)
on registers 96, 97, 98, 99. If a request is
submitted with a starting register address of 96
and a quantity of registers of 5, then this request
will fail with Exception Code 0x02 “Illegal Data
Address” since it attempts to operate on registers
96, 97, 98, 99 and 100, and there is no register
with address 100.

03​
ILLEGAL DATA VALUE A value contained in the query data field is not an
allowable value for server (or slave). This
indicates a fault in the structure of the remainder
of a complex request, such as that the implied
length is incorrect. It specifically does NOT mean
that a data item submitted for storage in a register
has a value outside the expectation of the
application program, since the MODBUS protocol
is unaware of the significance of any particular
value of any particular register.

04​
SLAVE DEVICE FAILURE An unrecoverable error occurred while the server
(or slave) was attempting to perform the
requested action.

05​
ACKNOWLEDGE Specialized use in conjunction with programming
commands.
The server (or slave) has accepted the request
and is processing it, but a long duration of time
will be required to do so. This response is
returned to prevent a timeout error from occurring
in the client (or master). The client (or master)
can next issue a Poll Program Complete message
to determine if processing is completed.

06​
SLAVE DEVICE BUSY Specialized use in conjunction with programming
commands.
The server (or slave) is engaged in processing a
long–duration program command. The client (or
master) should retransmit the message later when
the server (or slave) is free.

08​
MEMORY PARITY ERROR Specialized use in conjunction with function codes
20 and 21 and reference type 6, to indicate that
the extended file area failed to pass a consistency
check.
MODBUS Application Protocol Specification V1.1b Modbus-IDA

December 28, 2006
http://www.Modbus-IDA.org 50/
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo K-SYSTEM-D,

Du musst die Bytes 8 und 9 sowie 10 und 11 in Deiner Anfrage tauschen.

Byte 8 16#30
Byte 9 16#00
Byte 10 16#00
Byte 11 16#08

Damit wird der 750-881 auf Deine Anfrage antworten.


Bei weiteren Fragen könnt Ihr uns auch gerne unter den unten genannten Adressdaten direkt kontaktieren.
 
Zurück
Oben