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

Represents an abstract base class of PLC values. More...

Inheritance diagram for PlcValue:
PlcArray PlcBoolean PlcByte PlcChar PlcDate PlcDateTime PlcDouble PlcInt16 PlcInt32 PlcReal PlcS5Time PlcString PlcTime PlcTimeOfDay PlcUInt16 PlcUInt32

Public Member Functions

function get Address (in this)
 Gets the address of the PLC value.
 
function GetValue (in this, in source)
 Retrieves the current value of the PLC value from the source specified. More...
 
function IsValidType (in this, in value)
 Determines whether a specified value is acceptable for this PlcValue. More...
 
function IsValidValue (in this, in value)
 Determines whether the provided value is accepted for the type of PLC value through basic type checking and also potentially if it is within the allowed range of value for that type. More...
 
function SetValue (in this, in target, in value)
 Stores the value in the target specified. More...
 

Public Attributes

Property Address
 Gets the address of the PLC value. The PlcAddress used by the PLC value.
 
Property Value
 Gets or sets the value assigned to the PLC value. The value assigned to the PLC value.
 
Property ManagedInstance
 This property is not intended to be used outside of the toolbox.
 

Protected Member Functions

function PlcValue (in typeCode, in address, in length, in value)
 Initializes a new instance of the PlcValue class. More...
 

Detailed Description

Represents an abstract base class of PLC values.

Constructor & Destructor Documentation

◆ PlcValue()

function PlcValue::PlcValue ( in  typeCode,
in  address,
in  length,
in  value 
)
protected

Initializes a new instance of the PlcValue class.

Parameters
typeCodeOne of the members defined by the PlcTypeCode enumeration class which defines the concrete type of value represented.
addressThe PlcAddress of the new PlcValue to which the PLC value belongs.
lengthThe length of data represented.
valueThe initial value of the new PlcValue.

Member Function Documentation

◆ GetValue()

function PlcValue::GetValue ( in  this,
in  source 
)

Retrieves the current value of the PLC value from the source specified.

Parameters
thisThe instance of the PlcValue class to operate on.
sourceThe PlcDevice or PlcDeviceConnection from that the data is to be retrieved.
Return values
valueThe current value of the PLC value.

◆ IsValidType()

function PlcValue::IsValidType ( in  this,
in  value 
)

Determines whether a specified value is acceptable for this PlcValue.

Parameters
thisThe instance of the PlcValue class to operate on.
valueThe value to check.
Return values
valueThe value true, if the specified value is the type or an acceptable derived type; otherwise the value false.

◆ IsValidValue()

function PlcValue::IsValidValue ( in  this,
in  value 
)

Determines whether the provided value is accepted for the type of PLC value through basic type checking and also potentially if it is within the allowed range of value for that type.

Parameters
thisThe instance of the PlcValue class to operate on.
valueThe value to check.
Return values
valueThe value true, if the specified value is acceptable and is of the correct type or a derived type; otherwise the value false.

◆ SetValue()

function PlcValue::SetValue ( in  this,
in  target,
in  value 
)

Stores the value in the target specified.

Parameters
thisThe instance of the PlcValue class to operate on.
targetThe PlcDevice or PlcDeviceConnection to use to store the data.
valueThe value to be stored.

Errors

  • The value is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue.

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