AC_Visu_Base (FB)

FUNCTION_BLOCK ABSTRACT AC_Visu_Base

This function block implements the logic of the visualizations generated by GenVisu.

Specific information about the ancestor visualization and custom behavior on frame changes is provided by extending this FB and implementing the methods GetAncestor() and OnFrameChanged().

This FB must be called cyclically, preferably at the end of the visu task.

Inputs

  • If uiFrameIdx is set to a value different from uiCurFrameIdx, the frame is changed in the next cycle

  • If xUp, xBack, or xFwd is set, the corresponding navigation is performed in the next cycle.

  • If x…Pressed is set or reset, the output state (i…State) is set accordingly.

Note: At the end of each cycle, xUp, xBack, and xFwd are set to FALSE and uiFrameIdx is set to uiCurFrameIdx.

Outputs

  • The output variable uiCurFrameIdx controls which visualization is displayed in the main frame of the toplevel visualization.

  • The output variables stAddr controls the content of the address bar.

  • The output variables i…State control whether the respective navigation buttons are pressed or disabled.

Additional functions created during generation

  • During generation this function block gets attached a method GetModuleFrameIndex, which allows to get the index of the page visu in the main frame, which belongs to certain module

  • By this it is possible to arbitrallily change pages visus and i.e. jump from one page visu to a completelly different on depending on some own IEC logic.

InOut:

Scope

Name

Type

Initial

Comment

Input

uiFrameIdx

UINT

0

The new frame index to change to

xUp

BOOL

FALSE

Whether Up() should be called

xBack

BOOL

FALSE

Whether Back() should be called

xFwd

BOOL

FALSE

Whether Forward() should be called

xUpPressed

BOOL

FALSE

Whether the Up button is currently pressed

xBackPressed

BOOL

FALSE

Whether the Back button is currently pressed

xFwdPressed

BOOL

FALSE

Whether the Forward button is currently pressed

Output

uiCurFrameIdx

UINT

0

The current frame index

stAddr

STRING

‘’

The current “module address” displayed in the visu

iUpState

INT

0

0: neutral, 1: pressed, 2: disabled

iBackState

INT

0

0: neutral, 1: pressed, 2: disabled

iFwdState

INT

0

0: neutral, 1: pressed, 2: disabled

Methods:

Structure: