pascalSCADA OPM: PLCMemoryManager: Class TRegisterRange

Pascal SCADA OPM

Class TRegisterRange

Unit

PLCMemoryManager

Declaration

type TRegisterRange = class(TObject)

Description

:

Continuous memory block class.

Attention: If are you developing a protocol driver, use the class TPLCMemoryManager, that implements the non-continuous memory blocks. This class uses TRegisterRange and all their descendents.

See also
TPLCMemoryManager
Class that handles non-continuous memory blocks (fragmented) and the better organization of it.

Hierarchy

  • TObject
  • TRegisterRange

Overview

Fields

Public FValues:TArrayOfDouble;
Public LastError:TProtocolIOResult;

Methods

Public constructor Create(AdrStart,AdrEnd:Cardinal);
Public destructor Destroy; override;
Public procedure Updated;
Public function NeedRefresh:Boolean;

Properties

Public property Values[Index:LongInt]: Double read GetValue write SetValue;
Published property AddressStart: LongInt read FStartAddress;
Published property AddressEnd: LongInt read FEndAddress;
Published property Size: LongInt read GetSize;
Published property LastUpdate: TDateTime read FLastUpdate write FLastUpdate;
Published property MilisecondsFromLastUpdate: Int64 read GetMsecLastUpdate;
Published property ScanTime: Cardinal read FMinScanTime write FMinScanTime;
Published property ReadSuccess: Cardinal read FReadOK write SetReadOK;
Published property ReadFaults: Cardinal read FReadFault write SetReadFault;

Description

Fields

Public FValues:TArrayOfDouble;

: Array that stores the values of the memory block.

Public LastError:TProtocolIOResult;

: Armazena o último erro ocorrido com o bloco.

Methods

Public constructor Create(AdrStart,AdrEnd:Cardinal);

: Creates a continuous memory block

AdrStart and AdrEnd must be passed in the memory unit of the smaller word available on your PLC. A example is the Siemens PLC's, that can use on the same memory area, bytes, Words e DWORDs. So to add the MD0, you must pass 0 to AdrStart and 3 to AdrEnd, totalizing 4 bytes (which is the less word size on this PLC) which are the MB0, MB1, MB2, MB3, forming the MD0.

Parameters
AdrStart
Cardinal. Start address of the block.
AdrEnd
Cardinal. Final address of the block.
Public destructor Destroy; override;
 
Public procedure Updated;

: Updated updates the timestamp of the block values. Call this method after read values of your device.

Public function NeedRefresh:Boolean;

: NeedRefresh tells if the memory block must be read from the device, because the scan time elapses (Now - time from the last update > smaller scan time of the block).

Properties

Public property Values[Index:LongInt]: Double read GetValue write SetValue;

: Reads/writes a value at the specified index of the memory block.

Published property AddressStart: LongInt read FStartAddress;

: Start address of the memory block.

Published property AddressEnd: LongInt read FEndAddress;

: Final address of the memory block.

Published property Size: LongInt read GetSize;

: Tells the size of the block.

Published property LastUpdate: TDateTime read FLastUpdate write FLastUpdate;

: LastUpdate tells the timestamp of the last update.

Published property MilisecondsFromLastUpdate: Int64 read GetMsecLastUpdate;

: MilisecondsFromLastUpdate tells how many milliseconds are elapsed from the last update.

Published property ScanTime: Cardinal read FMinScanTime write FMinScanTime;

: Tells the smaller scan time of the memory block.

Published property ReadSuccess: Cardinal read FReadOK write SetReadOK;

: Tells how many reads was successful.

Published property ReadFaults: Cardinal read FReadFault write SetReadFault;

: Tells how many reads was not successful.

Author


Generated by PasDoc 0.14.0.