SIMATIC S7 MatLab Toolbox
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
PlcDeviceConnection Class Reference

Provides an abstract base class which represents a connection to a device. More...

Inheritance diagram for PlcDeviceConnection:
SimaticDeviceConnection

Public Types

enum  Events {
  Closed , Closing , Connected , Connecting ,
  Disconnected , Faulted , Opened , Opening
}
 The definition of the events defined by the PlcDeviceConnection. More...
 

Public Member Functions

function delete (in this)
 
function get BreakDetectionTimeout (in this)
 Gets the time that is used to detect a connection break.
 
function set BreakDetectionTimeout (in this, in value)
 Sets the time that is used to detect a connection break.
 
function get ConnectTimeout (in this)
 Gets the wait time before terminating the attempt to establish a connection.
 
function set ConnectTimeout (in this, in value)
 Sets the wait time before terminating the attempt to establish a connection.
 
function get Device (in this)
 Gets the PlcDevice associated with the connection.
 
function set Device (in this, in value)
 Sets the PlcDevice associated with the connection.
 
function get ReceiveTimeout (in this)
 Gets the wait time before terminating the attempt to receive data.
 
function set ReceiveTimeout (in this, in value)
 Sets the wait time before terminating the attempt to receive data.
 
function get State (in this)
 Gets a value that indicates the current state of the connection.
 
function get TransmitTimeout (in this)
 Gets the wait time before terminating the attempt to transmit data.
 
function set TransmitTimeout (in this, in value)
 Sets the wait time before terminating the attempt to transmit data.
 
function get UseBreakDetection (in this)
 Gets a value indicating whether a connection break detection is to be used.
 
function set UseBreakDetection (in this, in value)
 Sets a value indicating whether a connection break detection is to be used.
 
function Close (in this)
 Causes a connection to transition from its current state into the closed state while an established connection to a device will be closed. More...
 
function Connect (in this)
 Causes a connection to transition from the opened state into the connected state while it does fully establish a connection to a device. More...
 
function Open (in this)
 Causes a connection to transition from the created or closed state into the opened state while it does establish a connection to a device. More...
 
function ReadBoolean (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar logical value (in PLC a BOOL) or if count is specified an array of n logical values (in PLC an ARRAY OF BOOL). More...
 
function ReadByte (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar binary value (in PLC a BYTE) or if count is specified an array of n binary values (in PLC an ARRAY OF BYTE). More...
 
function ReadChar (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar character value (in PLC a CHAR) or if count is specified an array of n character values (in PLC an ARRAY OF CHAR). More...
 
function ReadDate (in this, in address)
 Reads the value stored at the specified address as a scalar date number (in PLC a DATE). More...
 
function ReadDateTime (in this, in address)
 Reads the value stored at the specified address as a scalar date number (in PLC a DATE_AND_TIME). More...
 
function ReadDouble (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar double value (in PLC a DOUBLE) or if count is specified an array of n double values (in PLC an ARRAY OF DOUBLE). More...
 
function ReadInt16 (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar int16 value (in PLC a INT) or if count is specified an array of n int16 values (in PLC an ARRAY OF INT). More...
 
function ReadInt32 (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar int32 value (in PLC a DINT) or if count is specified an array of n int32 values (in PLC an ARRAY OF DINT). More...
 
function ReadReal (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar single value (in PLC a REAL) or if count is specified an array of n single values (in PLC an ARRAY OF REAL). More...
 
function ReadS5Time (in this, in address)
 Reads the value stored at the specified address as a scalar date number value (in PLC a S5TIME), while the date number does only express time information. More...
 
function ReadString (in this, in address, in length)
 Reads the value stored at the specified address as a scalar string value (in PLC a TEXT). More...
 
function ReadTime (in this, in address)
 Reads the value stored at the specified address as a scalar date number value (in PLC a TIME), while the date number does only express time information. More...
 
function ReadTimeOfDay (in this, in address)
 Reads the value stored at the specified address as a scalar date number value (in PLC a TIME_OF_DAY), while the date number does only express time information. More...
 
function ReadUInt16 (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar uint16 value (in PLC a WORD) or if count is specified an array of n uint16 values (in PLC an ARRAY OF WORD). More...
 
function ReadUInt32 (in this, in address, in count)
 Reads the value(s) stored at the specified address as a scalar uint32 value (in PLC a DWORD) or if count is specified an array of n uint32 values (in PLC an ARRAY OF DWORD). More...
 
function ReadValues (in this, in values)
 Reads the values specified. More...
 
function WriteBoolean (in this, in address, in values)
 Writes the logical value(s) (in PLC BOOL or ARRAY OF BOOL) to the data area specified by address. More...
 
function WriteByte (in this, in address, in values)
 Writes the binary value(s) (in PLC BYTE or ARRAY OF BYTE) to the data area specified by address. More...
 
function WriteChar (in this, in address, in values)
 Writes the character value(s) (in PLC CHAR or ARRAY OF CHAR) to the data area specified by address. More...
 
function WriteDate (in this, in address, in value)
 Writes the date number (in PLC DATE) to the data area specified by address. More...
 
function WriteDateTime (in this, in address, in value)
 Writes the date number (in PLC DATE_AND_TIME) to the data area specified by address. More...
 
function WriteDouble (in this, in address, in values)
 Writes the double value(s) (in PLC DOUBLE or ARRAY OF DOUBLE) to the data area specified by address. More...
 
function WriteInt16 (in this, in address, in values)
 Writes the int16 value(s) (in PLC INT or ARRAY OF INT) to the data area specified by address. More...
 
function WriteInt32 (in this, in address, in values)
 Writes the int32 value(s) (in PLC DINT or ARRAY OF DINT) to the data area specified by address. More...
 
function WriteReal (in this, in address, in values)
 Writes the single value(s) (in PLC REAL or ARRAY OF REAL) to the data area specified by address. More...
 
function WriteS5Time (in this, in address, in value)
 Writes the time part of the date number (in PLC S5TIME) to the data area specified by address. More...
 
function WriteString (in this, in address, in value)
 Writes the string (in PLC TEXT) to the data area specified by address. More...
 
function WriteTime (in this, in address, in value)
 Writes the time part of the date number (in PLC TIME) to the data area specified by address. More...
 
function WriteTimeOfDay (in this, in address, in value)
 Writes the time part of the date number (in PLC TIME_OF_DAY) to the data area specified by address. More...
 
function WriteUInt16 (in this, in address, in values)
 Writes the uint16 value(s) (in PLC WORD or ARRAY OF WORD) to the data area specified by address. More...
 
function WriteUInt32 (in this, in address, in values)
 Writes the uint32 value(s) (in PLC DWORD or ARRAY OF DWORD) to the data area specified by address. More...
 
function WriteValues (in this, in values)
 Writes the values specified. More...
 

Public Attributes

Constant Property DefaultTimeout = 5000
 brief Represents the default timeout value that is used by the PlcDeviceConnection as initial value of all timeout properties.
 
Property BreakDetectionTimeout
 Gets or sets the time that is used to detect a connection break. The time in milliseconds to detect a connection break.
 
Property ConnectTimeout
 Gets or sets the wait time before terminating the attempt to establish a connection. The time in milliseconds to wait for the connection to connect.
 
Property ReceiveTimeout
 Gets or sets the wait time before terminating the attempt to receive data. The time in milliseconds to wait for the connection to receive.
 
Property State
 Gets a value that indicates the current state of the connection. One of the members defined by the PlcDeviceConnectionState enumeration. Which specifies the current state of the connection.
 
Property TransmitTimeout
 Gets or sets the wait time before terminating the attempt to transmit data. The time in milliseconds to wait for the connection to transmit.
 
Property UseBreakDetection
 Gets or sets a value indicating whether a connection break detection is to be used. The default value of this property is false.
 
Property ManagedInstance
 This property is not intended to be used outside of the toolbox.
 

Protected Member Functions

function PlcDeviceConnection (in device)
 Initializes a new instance of the PlcDeviceConnection class using the specified device. More...
 

Detailed Description

Provides an abstract base class which represents a connection to a device.

Member Enumeration Documentation

◆ Events

The definition of the events defined by the PlcDeviceConnection.

Enumerator
Closed 

Occurs when a connection transitions into the closed state.

Closing 

Occurs when a connection transitions into the closing state.

Connected 

Occurs when a connection transitions into the connected state.

Connecting 

Occurs when a connection transitions into the connecting state.

Disconnected 

Occurs when a connection transitions into the disconnected state.

Faulted 

Occurs when a connection transitions into the faulted state.

Opened 

Occurs when a connection transitions into the opened state.

Opening 

Occurs when a connection transitions into the opening state.

Constructor & Destructor Documentation

◆ PlcDeviceConnection()

function PlcDeviceConnection::PlcDeviceConnection ( in  device)
protected

Initializes a new instance of the PlcDeviceConnection class using the specified device.

Parameters
deviceThe PlcDevice associated with the new PlcDeviceConnection.

Errors

  • The device is not an instance of the PlcDevice class.

Member Function Documentation

◆ Close()

function PlcDeviceConnection::Close ( in  this)

Causes a connection to transition from its current state into the closed state while an established connection to a device will be closed.

Errors

◆ Connect()

function PlcDeviceConnection::Connect ( in  this)

Causes a connection to transition from the opened state into the connected state while it does fully establish a connection to a device.

Errors

Remarks

In case there is already a connection fully established (see IsConnected) Connect does not perform any connect attempt.

◆ delete()

function PlcDeviceConnection::delete ( in  this)

Performs toolbox-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ Open()

function PlcDeviceConnection::Open ( in  this)

Causes a connection to transition from the created or closed state into the opened state while it does establish a connection to a device.

Errors

◆ ReadBoolean()

function PlcDeviceConnection::ReadBoolean ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar logical value (in PLC a BOOL) or if count is specified an array of n logical values (in PLC an ARRAY OF BOOL).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadByte()

function PlcDeviceConnection::ReadByte ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar binary value (in PLC a BYTE) or if count is specified an array of n binary values (in PLC an ARRAY OF BYTE).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadChar()

function PlcDeviceConnection::ReadChar ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar character value (in PLC a CHAR) or if count is specified an array of n character values (in PLC an ARRAY OF CHAR).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadDate()

function PlcDeviceConnection::ReadDate ( in  this,
in  address 
)

Reads the value stored at the specified address as a scalar date number (in PLC a DATE).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadDateTime()

function PlcDeviceConnection::ReadDateTime ( in  this,
in  address 
)

Reads the value stored at the specified address as a scalar date number (in PLC a DATE_AND_TIME).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadDouble()

function PlcDeviceConnection::ReadDouble ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar double value (in PLC a DOUBLE) or if count is specified an array of n double values (in PLC an ARRAY OF DOUBLE).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadInt16()

function PlcDeviceConnection::ReadInt16 ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar int16 value (in PLC a INT) or if count is specified an array of n int16 values (in PLC an ARRAY OF INT).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadInt32()

function PlcDeviceConnection::ReadInt32 ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar int32 value (in PLC a DINT) or if count is specified an array of n int32 values (in PLC an ARRAY OF DINT).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadReal()

function PlcDeviceConnection::ReadReal ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar single value (in PLC a REAL) or if count is specified an array of n single values (in PLC an ARRAY OF REAL).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadS5Time()

function PlcDeviceConnection::ReadS5Time ( in  this,
in  address 
)

Reads the value stored at the specified address as a scalar date number value (in PLC a S5TIME), while the date number does only express time information.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadString()

function PlcDeviceConnection::ReadString ( in  this,
in  address,
in  length 
)

Reads the value stored at the specified address as a scalar string value (in PLC a TEXT).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
lengthThe length of the string value to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadTime()

function PlcDeviceConnection::ReadTime ( in  this,
in  address 
)

Reads the value stored at the specified address as a scalar date number value (in PLC a TIME), while the date number does only express time information.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadTimeOfDay()

function PlcDeviceConnection::ReadTimeOfDay ( in  this,
in  address 
)

Reads the value stored at the specified address as a scalar date number value (in PLC a TIME_OF_DAY), while the date number does only express time information.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
Return values
valueThe value stored at the area specified by address.

Errors

◆ ReadUInt16()

function PlcDeviceConnection::ReadUInt16 ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar uint16 value (in PLC a WORD) or if count is specified an array of n uint16 values (in PLC an ARRAY OF WORD).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadUInt32()

function PlcDeviceConnection::ReadUInt32 ( in  this,
in  address,
in  count 
)

Reads the value(s) stored at the specified address as a scalar uint32 value (in PLC a DWORD) or if count is specified an array of n uint32 values (in PLC an ARRAY OF DWORD).

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to read.
countThe number of values to read from the data area.
Return values
valueThe value(s) stored at the area specified by address.

Errors

◆ ReadValues()

function PlcDeviceConnection::ReadValues ( in  this,
in  values 
)

Reads the values specified.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
valuesThe values to be read (as cell array).
Return values
valueAn array of the values read.

Errors

◆ WriteBoolean()

function PlcDeviceConnection::WriteBoolean ( in  this,
in  address,
in  values 
)

Writes the logical value(s) (in PLC BOOL or ARRAY OF BOOL) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe logical values to write to the area specified by address.

Errors

◆ WriteByte()

function PlcDeviceConnection::WriteByte ( in  this,
in  address,
in  values 
)

Writes the binary value(s) (in PLC BYTE or ARRAY OF BYTE) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe binary values to write to the area specified by address.

Errors

◆ WriteChar()

function PlcDeviceConnection::WriteChar ( in  this,
in  address,
in  values 
)

Writes the character value(s) (in PLC CHAR or ARRAY OF CHAR) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe character values to write to the area specified by address.

Errors

◆ WriteDate()

function PlcDeviceConnection::WriteDate ( in  this,
in  address,
in  value 
)

Writes the date number (in PLC DATE) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe date number to write to the area specified by address.

Errors

◆ WriteDateTime()

function PlcDeviceConnection::WriteDateTime ( in  this,
in  address,
in  value 
)

Writes the date number (in PLC DATE_AND_TIME) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe date number to write to the area specified by address.

Errors

◆ WriteDouble()

function PlcDeviceConnection::WriteDouble ( in  this,
in  address,
in  values 
)

Writes the double value(s) (in PLC DOUBLE or ARRAY OF DOUBLE) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe double values to write to the area specified by address.

Errors

◆ WriteInt16()

function PlcDeviceConnection::WriteInt16 ( in  this,
in  address,
in  values 
)

Writes the int16 value(s) (in PLC INT or ARRAY OF INT) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe int16 values to write to the area specified by address.

Errors

◆ WriteInt32()

function PlcDeviceConnection::WriteInt32 ( in  this,
in  address,
in  values 
)

Writes the int32 value(s) (in PLC DINT or ARRAY OF DINT) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe int32 values to write to the area specified by address.

Errors

◆ WriteReal()

function PlcDeviceConnection::WriteReal ( in  this,
in  address,
in  values 
)

Writes the single value(s) (in PLC REAL or ARRAY OF REAL) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe single values to write to the area specified by address.

Errors

◆ WriteS5Time()

function PlcDeviceConnection::WriteS5Time ( in  this,
in  address,
in  value 
)

Writes the time part of the date number (in PLC S5TIME) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe date number to write to the area specified by address.

Errors

◆ WriteString()

function PlcDeviceConnection::WriteString ( in  this,
in  address,
in  value 
)

Writes the string (in PLC TEXT) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe string to write to the area specified by address.

Errors

◆ WriteTime()

function PlcDeviceConnection::WriteTime ( in  this,
in  address,
in  value 
)

Writes the time part of the date number (in PLC TIME) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe date number to write to the area specified by address.

Errors

◆ WriteTimeOfDay()

function PlcDeviceConnection::WriteTimeOfDay ( in  this,
in  address,
in  value 
)

Writes the time part of the date number (in PLC TIME_OF_DAY) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valueThe date number to write to the area specified by address.

Errors

◆ WriteUInt16()

function PlcDeviceConnection::WriteUInt16 ( in  this,
in  address,
in  values 
)

Writes the uint16 value(s) (in PLC WORD or ARRAY OF WORD) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe uint16 values to write to the area specified by address.

Errors

◆ WriteUInt32()

function PlcDeviceConnection::WriteUInt32 ( in  this,
in  address,
in  values 
)

Writes the uint32 value(s) (in PLC DWORD or ARRAY OF DWORD) to the data area specified by address.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
addressThe address of the data area to that the values are to be written.
valuesThe uint32 values to write to the area specified by address.

Errors

◆ WriteValues()

function PlcDeviceConnection::WriteValues ( in  this,
in  values 
)

Writes the values specified.

Parameters
thisThe instance of the PlcDeviceConnection class to operate on.
valuesThe values to write (as cell array).

Errors


The documentation for this class was generated from the following file: