public interface

IS7Block

com.pnfsoftware.jeb.core.units.code.simatic.IS7Block

Class Overview

Interface for S7 blocks. Implementations of this interface are private. They represent different concrete implementations of a PLC block.

Currently, two implementations exist:
- binary format 1 (little-endian): used by Step 7 internally
- binary format 2 (big-endian): used during networks communication between a PLC and the Programming Station (header starts with 'pp')

Summary

Public Methods
abstract INativeType generateNativeHeaderType(ITypeManager typeman)
abstract INativeType generateNativeTrailerType(ITypeManager typeman)
abstract int getBlockByte(int offset)
abstract byte[] getBlockBytes()
abstract int getBlockFormatVersion()
Retrieve the block format version.
abstract int getBlockSize()
abstract int getCrc()
abstract byte[] getInterfaceBytes()
abstract long getInterfaceModificationTimestamp()
abstract int getInterfaceOffset()
abstract int getInterfaceSize()
abstract int getKey()
abstract String getMetadataAuthorName()
abstract String getMetadataBlockName()
abstract String getMetadataFamilyName()
abstract long getModificationTimestamp()
abstract String getName()
Generate this block's normal name, that is <BLOCK_TYPE><BLOCK_NUMBER>.
abstract int getNumber()
abstract byte[] getOtherBytes()
abstract int getOtherOffset()
abstract int getOtherSize()
abstract byte[] getPayloadBytes()
Retrieve the block's payload.
abstract int getPayloadOffset()
Get the payload offset within the block bytes.
abstract int getPayloadSize()
Get the payload size in bytes.
abstract S7.LangType getSourceLanguage()
abstract int getSourceLanguageId()
abstract int getTrailerOffset()
abstract S7.BlockType getType()
abstract int getTypeId()
abstract int[] getVersion()
abstract boolean isInstanceDataBlock()
Determine whether this block is an instance data block.

Public Methods

public abstract INativeType generateNativeHeaderType (ITypeManager typeman)

public abstract INativeType generateNativeTrailerType (ITypeManager typeman)

public abstract int getBlockByte (int offset)

public abstract byte[] getBlockBytes ()

public abstract int getBlockFormatVersion ()

Retrieve the block format version.

Returns
  • an opaque 16-bit version number (for the block format, not the block itself)

public abstract int getBlockSize ()

public abstract int getCrc ()

public abstract byte[] getInterfaceBytes ()

public abstract long getInterfaceModificationTimestamp ()

Returns
  • in ms since the epoch (1970/01/01)

public abstract int getInterfaceOffset ()

public abstract int getInterfaceSize ()

public abstract int getKey ()

public abstract String getMetadataAuthorName ()

public abstract String getMetadataBlockName ()

public abstract String getMetadataFamilyName ()

public abstract long getModificationTimestamp ()

Returns
  • in ms since the epoch (1970/01/01)

public abstract String getName ()

Generate this block's normal name, that is <BLOCK_TYPE><BLOCK_NUMBER>. Examples: OB1, FB5, DB10.

Returns
  • the normal name

public abstract int getNumber ()

public abstract byte[] getOtherBytes ()

public abstract int getOtherOffset ()

public abstract int getOtherSize ()

public abstract byte[] getPayloadBytes ()

Retrieve the block's payload.

For a logic block, the payload bytes are the MC7 bytecode of the function. For a data block, the payload bytes are the current values of the interface elements (which may differ from the initial values, if any).

public abstract int getPayloadOffset ()

Get the payload offset within the block bytes.

public abstract int getPayloadSize ()

Get the payload size in bytes.

public abstract S7.LangType getSourceLanguage ()

public abstract int getSourceLanguageId ()

public abstract int getTrailerOffset ()

Returns
  • optional trailer offset, -1 if there is no trailer

public abstract S7.BlockType getType ()

public abstract int getTypeId ()

public abstract int[] getVersion ()

Returns
  • two-element array: {major version (0..15), minor version (0..15)}

public abstract boolean isInstanceDataBlock ()

Determine whether this block is an instance data block. The block type may be DB or DI.