S7Client

Description

› Inherits:

Object

Overview

Properties

Methods

Signals

Enumerations

Properties

autoConnect

This property holds whether the S7 client should connect to the S7 server automatically. Keeping this option enabled will also make the client reconnect on connection errors.

› Type:

Boolean

› Default:

true

› Signal:

autoConnectChanged()

› Attributes:

Writable

byteOrder

This property holds the byte order of the data read from or written to the PLC.

This property was introduced in InCore 2.8.

› Type:

ByteOrder

› Default:

S7Client.BigEndian

› Signal:

byteOrderChanged()

› Attributes:

Writable

connected

This property holds whether the S7 client is connected to the S7 server.

› Type:

Boolean

› Default:

false

› Signal:

connectedChanged()

› Attributes:

Writable

connectionType

This property holds the connection type which to use for conneting to the S7 server.

› Type:

ConnectionType

› Default:

S7Client.PG

› Signal:

connectionTypeChanged()

› Attributes:

Writable

error

This property holds the most recently occurred error or S7Client.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.

› Type:

Error

› Signal:

errorChanged()

› Attributes:

Readonly

errorString

This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.

› Type:

String

› Signal:

errorStringChanged()

› Attributes:

Readonly

hostname

This property holds the hostname of the S7 server to connect to.

› Type:

String

› Signal:

hostnameChanged()

› Attributes:

Writable

localTsap

› Type:

SignedInteger

› Default:

256

› Signal:

localTsapChanged()

› Attributes:

Writable

moduleName

› Type:

String

› Signal:

moduleNameChanged()

› Attributes:

Readonly

moduleTypeName

› Type:

String

› Signal:

moduleTypeNameChanged()

› Attributes:

Readonly

port

This property holds the port which the S7 server is listening at.

› Type:

SignedInteger

› Default:

102

› Signal:

portChanged()

› Attributes:

Writable

rack

› Type:

SignedInteger

› Default:

0

› Signal:

rackChanged()

› Attributes:

Writable

remoteTsap

› Type:

SignedInteger

› Default:

0

› Signal:

remoteTsapChanged()

› Attributes:

Writable

serialNumber

› Type:

String

› Signal:

serialNumberChanged()

› Attributes:

Readonly

slot

› Type:

SignedInteger

› Default:

0

› Signal:

slotChanged()

› Attributes:

Writable

Methods

connectToHost()

disconnectFromHost()

Signals

errorOccurred()

This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.

Enumerations

ByteOrder

Name

Value

Description

S7Client.BigEndian

0

S7Client.LittleEndian

1

ConnectionType

Name

Value

Description

S7Client.PG

1

S7Client.OP

2

S7Client.Basic

3

Error

This enumeration describes all errors which can occur in S7Client objects. The most recently occurred error is stored in the error property.

Name

Value

Description

S7Client.InvalidObject

-2

LIB: Invalid object supplied.

S7Client.InvalidParam

-1

LIB: Invalid param supplied.

S7Client.NoError

0

No error occurred or was detected.

S7Client.ConnectError

65536

ISO: Connection error.

S7Client.DisconnectError

131072

ISO: Disconnect error.

S7Client.InvalidPDU

196608

ISO: Bad PDU format.

S7Client.InvalidDataSize

262144

ISO: Datasize passed to send/recv buffer is invalid.

S7Client.NullPointer

327680

ISO: Null passed as pointer.

S7Client.ShortPacket

393216

ISO: A short packet received.

S7Client.TooManyFragments

458752

ISO: Too many packets without EoT flag.

S7Client.PduOverflow

524288

ISO: The sum of fragments data exceded maximum packet size.

S7Client.SendPacket

589824

ISO: An error occurred during send.

S7Client.RecvPacket

655360

ISO: An error occurred during recv.

S7Client.InvalidTSAP

720896

ISO: Invalid connection params (wrong TSAPs).

S7Client.NegotiatingPDU

1048576

CPU:Error in PDU negotiation.

S7Client.InvalidParams

2097152

CLI:invalid param(s) supplied.

S7Client.JobPending

3145728

CLI:Job pending.

S7Client.TooManyItems

4194304

CLI:too may items (>20) in multi read/write.

S7Client.InvalidWordLen

5242880

CLI:invalid WordLength.

S7Client.PartialDataWritten

6291456

CLI:Partial data written.

S7Client.SizeOverPDU

7340032

CPU:total data exceeds the PDU size.

S7Client.InvalidPlcAnswer

8388608

CLI:invalid CPU answer.

S7Client.AddressOutOfRange

9437184

CPU:Address out of range.

S7Client.InvalidTransportSize

10485760

CPU:Invalid Transport size.

S7Client.WriteDataSizeMismatch

11534336

CPU:Data size mismatch.

S7Client.ItemNotAvailable

12582912

CPU:Item not available.

S7Client.InvalidValue

13631488

CPU:Invalid value supplied.

S7Client.CannotStartPLC

14680064

CPU:Cannot start PLC.

S7Client.AlreadyRun

15728640

CPU:PLC already RUN.

S7Client.CannotStopPLC

16777216

CPU:Cannot stop PLC.

S7Client.CannotCopyRamToRom

17825792

CPU:Cannot copy RAM to ROM.

S7Client.CannotCompress

18874368

CPU:Cannot compress.

S7Client.AlreadyStop

19922944

CPU:PLC already STOP.

S7Client.FunNotAvailable

20971520

CPU:Function not available.

S7Client.UploadSequenceFailed

22020096

CPU:Upload sequence failed.

S7Client.InvalidDataSizeRecvd

23068672

CLI:Invalid data size received.

S7Client.InvalidBlockType

24117248

CLI:Invalid block type.

S7Client.InvalidBlockNumber

25165824

CLI:Invalid block number.

S7Client.InvalidBlockSize

26214400

CLI:Invalid block size.

S7Client.DownloadSequenceFailed

27262976

CPU:Download sequence failed.

S7Client.InsertRefused

28311552

CPU:block insert refused.

S7Client.DeleteRefused

29360128

CPU:block delete refused.

S7Client.NeedPassword

30408704

CPU:Function not authorized for current protection level.

S7Client.InvalidPassword

31457280

CPU:Invalid password.

S7Client.NoPasswordToSetOrClear

32505856

CPU:No password to set or clear.

S7Client.JobTimeout

33554432

CLI:Job Timeout.

S7Client.PartialDataRead

34603008

CLI:Partial data read.

S7Client.BufferTooSmall

35651584

CLI:The buffer supplied is too small to accomplish the operation.

S7Client.FunctionRefused

36700160

CLI:function refused by CPU (Unknown error).

S7Client.Destroying

37748736

CLI:Cannot perform (destroying).

S7Client.InvalidParamNumber

38797312

CLI:Invalid Param Number.

S7Client.CannotChangeParam

39845888

CLI:Cannot change this param now.