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:

## 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

enum PlcDeviceConnection::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

  device | The 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

- The connection is in PlcDeviceConnectionState.Faulted state and cannot longer be closed.

## ◆ 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

- The connection is not in PlcDeviceConnectionState.Opened or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

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

- The connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Bit.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  length | The length of the string value to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The length is out of the bounds defined by PlcString.MinLength and PlcString.MaxLength.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.

Return values

  value | The value stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to read.
  count | The number of values to read from the data area.

Return values

  value | The value(s) stored at the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ ReadValues()

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

Reads the values specified.

Parameters

  this | The instance of the PlcDeviceConnection class to operate on.
  values | The values to be read (as cell array).

Return values

  value | An array of the values read.

Errors

- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The logical values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Bit.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The binary values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The character values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The date number to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The value is out of the bounds defined by PlcDate.MinValue and PlcDate.MaxValue.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The date number to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The value is out of the bounds defined by PlcDateTime.MinValue and PlcDateTime.MaxValue.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The double values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The int16 values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The int32 values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The single values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The date number to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The value is out of the bounds defined by PlcS5Time.MinValue and PlcS5Time.MaxValue.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ WriteString()

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

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

Parameters

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The string to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Byte.
- The length of value is out of the bounds defined by PlcString.MinLength and PlcString.MaxLength.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The date number to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The value is out of the bounds defined by PlcTime.MinValue and PlcTime.MaxValue.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  value | The date number to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The value is out of the bounds defined by PlcTimeOfDay.MinValue and PlcTimeOfDay.MaxValue.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The uint16 values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.Word.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ 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

  this | The instance of the PlcDeviceConnection class to operate on.
  address | The address of the data area to that the values are to be written.
  values | The uint32 values to write to the area specified by address.

Errors

- The address is an empty string or does not refer to the PlcRawType.DWord.
- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

## ◆ WriteValues()

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

Writes the values specified.

Parameters

  this | The instance of the PlcDeviceConnection class to operate on.
  values | The values to write (as cell array).

Errors

- The connection is not in PlcDeviceConnectionState.Opened, PlcDeviceConnectionState.Connected or PlcDeviceConnectionState.Disconnected state and is therefore not ready to use or the connection is in PlcDeviceConnectionState.Faulted state and cannot longer be used.

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

- PlcDeviceConnection.m