FB_TermRegRead_TcPfw()

FB_TermRegRead_TcPfw() 1:

A function block of this type is used by FB_TempCtrlCallback_TcPfw for read access to EL terminals.

Syntax

VAR_INPUT
    Execute       : BOOL;
    TermType      : E_TcPfw_TerminalType:=eTcPfwTermT_NoTerminal;
    Select        : INT:=-1;
    CycleTime     : LREAL:=0.025;
END_VAR
VAR_IN_OUT
    Ctrl          : USINT;
    State         : USINT;
    InData        : INT;
    OutData       : INT;
END_VAR
VAR_OUTPUT
    RegData       : WORD:=0;
    Busy          : BOOL:=FALSE;
    Done          : BOOL:=FALSE;
    CommandAborted: BOOL:=FALSE;
    Error         : BOOL:=FALSE;
    ErrorID       : UDINT:=0;
END_VAR

FB_TermRegRead_TcPfw() 2: Inputs

Name

Type

Description

Execute

BOOL

A rising edge starts the process.
A falling edge clears all outputs.

TermType

E_TcPfw_TerminalType

The coded type of the addressed terminal.

Select

INT

The register address of the terminal.

CycleTime

LREAL

The cycle time of the calling task.

FB_TermRegRead_TcPfw() 3: Inputs/outputs

Name

Type

Description

Ctrl

USINT

A reference to ST_TcPfw_TempCtrlOutput.KL_SnsCtrl of the terminal.

State

USINT

A reference to ST_TcPfw_TempCtrlInput.KL_SnsState of the terminal.

InData

INT

A reference to ST_TcPfw_TempCtrlInput.KL_SnsData of the terminal.

OutData

INT

A reference to ST_TcPfw_TempCtrlOutput.KL_SnsData of the terminal.

FB_TermRegRead_TcPfw() 4: Outputs

Name

Type

Description

RegData

WORD

If successfully executed, the read register content is provided here.

Busy

BOOL

The ongoing activity of the function block is signaled here.

Done

BOOL

The successful completion of the operation is reported here.

CommandAborted

BOOL

A TRUE indicates here that the process was aborted.

Error

BOOL

A TRUE indicates here the occurrence of a problem.

ErrorID

UDINT

In the event of an error, coded information is provided here.

Behavior of the function block:

A rising edge at Execute causes the function block to perform a series of checks:

If one of the above conditions is not met, an error is reported. Otherwise, the access is transmitted to the terminal. The result of the transmission is provided at the outputs.

FB_TermRegRead_TcPfw() 5:

In addition to the above-mentioned error possibilities, problems can occur during transmission. Furthermore, the terminal can report a problem (addressing, values, access type).

FB_TermRegRead_TcPfw() 6:

A register access requires that all elements with name beginning with "KL_" in ST_TcPfw_TempCtrlInput are linked.