# Interface: com.pnfsoftware.jeb.core.units.code.simatic.IS7Block

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'\)

## Method: generateNativeHeaderType
- parameter: `typeman`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`

Description: Generate a native type describing the block header.
parameter: typeman: type manager
return: native header type

## Method: generateNativeTrailerType
- parameter: `typeman`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`

Description: Generate a native type describing the block trailer.
parameter: typeman: type manager
return: native trailer type, null if this block format has no trailer

## Method: getBlockByte
- parameter: `offset`, type: `int`
- return type: `int`

Description: Retrieve a byte from the complete block data.
parameter: offset: byte offset
return: byte value

## Method: getBlockBytes
- return type: `byte[]`

Description: Retrieve the complete block bytes.
return: block bytes

## Method: getBlockFormatVersion
- return type: `int`

Description: Retrieve the block format version.
return: an opaque 16\-bit version number \(for the block format, not the block itself\)

## Method: getBlockSize
- return type: `int`

Description: Retrieve the total size of the block data.
return: block size in bytes

## Method: getCrc
- return type: `int`

Description: Retrieve the block CRC.
return: CRC value

## Method: getInterfaceBytes
- return type: `byte[]`

Description: Retrieve the interface bytes.
return: interface bytes

## Method: getInterfaceModificationTimestamp
- return type: `long`

Description: 
return: in ms since the epoch \(1970/01/01\)

## Method: getInterfaceOffset
- return type: `int`

Description: Retrieve the interface offset within the block bytes.
return: interface offset

## Method: getInterfaceSize
- return type: `int`

Description: Retrieve the interface size.
return: interface size in bytes

## Method: getKey
- return type: `int`

Description: Retrieve the block key.
return: key value

## Method: getMetadataAuthorName
- return type: `java.lang.String`

Description: Retrieve the metadata author name.
return: author name, possibly empty

## Method: getMetadataBlockName
- return type: `java.lang.String`

Description: Retrieve the metadata block name.
return: block name, possibly empty

## Method: getMetadataFamilyName
- return type: `java.lang.String`

Description: Retrieve the metadata family name.
return: family name, possibly empty

## Method: getModificationTimestamp
- return type: `long`

Description: 
return: in ms since the epoch \(1970/01/01\)

## Method: getName
- return type: `java.lang.String`

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

## Method: getNumber
- return type: `int`

Description: Retrieve the block number.
return: block number

## Method: getOtherBytes
- return type: `byte[]`

Description: Retrieve the additional data bytes.
return: additional data bytes

## Method: getOtherOffset
- return type: `int`

Description: Retrieve the offset of the additional data area.
return: additional data offset

## Method: getOtherSize
- return type: `int`

Description: Retrieve the size of the additional data area.
return: additional data size in bytes

## Method: getPayloadBytes
- return type: `byte[]`

Description: 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\).
return: payload bytes

## Method: getPayloadOffset
- return type: `int`

Description: Get the payload offset within the block bytes.
return: payload offset

## Method: getPayloadSize
- return type: `int`

Description: Get the payload size in bytes.
return: payload size in bytes

## Method: getSourceLanguage
- return type: `com.pnfsoftware.jeb.core.units.code.simatic.S7.LangType`

Description: Retrieve the source language.
return: source language

## Method: getSourceLanguageId
- return type: `int`

Description: Retrieve the raw source language id.
return: source language id

## Method: getTrailerOffset
- return type: `int`

Description: 
return: optional trailer offset, \-1 if there is no trailer

## Method: getType
- return type: `com.pnfsoftware.jeb.core.units.code.simatic.S7.BlockType`

Description: Retrieve the block type.
return: block type

## Method: getTypeId
- return type: `int`

Description: Retrieve the raw block type id.
return: block type id

## Method: getVersion
- return type: `int[]`

Description: 
return: two\-element array: {major version \(0..15\), minor version \(0..15\)}

## Method: isInstanceDataBlock
- return type: `boolean`

Description: Determine whether this block is an instance data block. The block type may be `DB` or `DI`.
return: true if this block is an instance data block

