getReasonCode

Declaration

int getReasonCode(S7RClientSSjToken token).

Purpose

This method gets ReasonCode value from the previously received message in the current buffer. Normally this is zero if ReturnCode field is zero. If ReturnCode is not zero, then this value is set by Substation ES to indicate problem

Parameters

Parameter Description
token The S7RClientSSjToken returned by Connect method.

Return

The method returns an int with the value of ReasonCode in the S7R data.

Example

S7RClientSSj conn = new S7RClientSSj();
S7RClientSSjToken token = conn.Connect(url, userid, password);
byte[] dataIn = conn.receiveWait(token);
if (dataIn != null) {
  int length = conn.getReasonCode(token);
}
conn.Disconnect(token);