FB_TermRegWrite_TcPfw()

FB_TermRegWrite_TcPfw() 1:

A function block of this type is used by FB_TempCtrlCallback_TcPfw for write access to KL terminals.

Syntax

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

FB_TermRegWrite_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.

RegData

WORD

The register content to be written is to be provided here.

CycleTime

LREAL

The cycle time of the calling task.

FB_TermRegWrite_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_TermRegWrite_TcPfw() 4: Outputs

Name

Type

Description

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_TermRegWrite_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_TermRegWrite_TcPfw() 6:

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