S7Variable

Description

› Inherits:

DataObject

Overview

Properties

Methods

Signals

Enumerations

Properties

address

This property holds the address (byte offset).

› Type:

SignedInteger

› Default:

0

› Signal:

addressChanged()

› Attributes:

Writable

bit

This property holds the bit number.

› Type:

SignedInteger

› Default:

0

› Signal:

bitChanged()

› Attributes:

Writable

client

› Type:

S7Client

› Signal:

clientChanged()

› Attributes:

Writable

db

This property holds the data block number.

› Type:

SignedInteger

› Default:

0

› Signal:

dbChanged()

› Attributes:

Writable

enabled

This property holds whether the variable is enabled. Poll will work only if enabled is true.

› Type:

Boolean

› Default:

true

› Signal:

enabledChanged()

› Attributes:

Writable

error

This property holds the most recently occurred error or S7Variable.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

type

This property holds the type of this variable. It’s set automatically if DataObject.name is set.

› Type:

Type

› Default:

S7Variable.InvalidType

› Signal:

typeChanged()

› Attributes:

Writable

Methods

pollData()

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

Error

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

Name

Value

Description

S7Variable.NoError

0

No error occurred or was detected.

S7Variable.InvalidClientError

1

Can’t send requests without a S7Client parent.

S7Variable.NameParseError

2

The variable name is malformed and could not be parsed.

Type

Name

Value

Description

S7Variable.InvalidType

0

S7Variable.DataBit

1

S7Variable.DataByte

2

S7Variable.DataWord

3

S7Variable.DataDoubleWord

4

S7Variable.DataInt16

5

S7Variable.DataInt32

6

S7Variable.DataReal

7

S7Variable.InputBit

8

S7Variable.InputByte

9

S7Variable.InputWord

10

S7Variable.InputDoubleWord

11

S7Variable.InputInt16

12

S7Variable.InputInt32

13

S7Variable.InputReal

14

S7Variable.OutputBit

15

S7Variable.OutputByte

16

S7Variable.OutputWord

17

S7Variable.OutputDoubleWord

18

S7Variable.OutputInt16

19

S7Variable.OutputInt32

20

S7Variable.OutputReal

21

S7Variable.MemoryBit

22

S7Variable.MemoryByte

23

S7Variable.MemoryWord

24

S7Variable.MemoryDoubleWord

25

S7Variable.MemoryInt16

26

S7Variable.MemoryInt32

27

S7Variable.MemoryReal

28