Function Block MEMDB_GLOBAL

The function block MEMDB_GLOBAL is a multiple global memory function.

This function block can be used to store several data directly in the application and make them available globally.

Tip: To list all elements used, click with the right mouse button on the function block. If the database has been used in another element, these will be displayed under Used By. The list is divided by the namespace of NS.

Database

The database DB is used to define the global namespace. For example: Licht.EIN or Lüftung.Störung etc.

This stores the data in the background. If the name is changed later in the program, data may be lost.

Input IN

Defines the data to be stored. The format does not matter.

Input NAME

The input defines the name of the memory location as a string. This must not be empty and must not contain a semicolon ";". Otherwise, saving will fail.

If the name is changed, the memory location changes immediately. This means that the previous value at the output is no longer available.

Input SAVE

On a positive edge, the value at input IN is copied to memory and output at Q. In addition, the value is synchronized with all other MEMDB_GLOBAL function blocks.

Input DELETE

On a positive edge, the memory of the selected name is deleted. The value NULL is again present at output Q.

Input RESET

On a positive edge, the entire memory is reset. The value NULL is again present at output Q.

Input NS

With input NS, a dynamic namespace can be added. This corresponds to a subordinate variable. This simplifies handling with the templates considerably. For the value to be synchronized, this must be identical to input NS.

Note: Since the name is extended with DB.NS, conflicts with other MEMDB_GLOBAL function blocks can occur. If NS is not defined, the internal variable has a dot at the end.

Output Q

Returns the memory of the database for the selected name. At initialization, this value is NULL.

Output ERR

The output is true if an error occurs. This is the case when the name was defined incorrectly.

Output NAMES

The output returns all memory banks as a string separated by a semicolon.

Output COUNT

The output returns the number of memory banks.